@necrolab/dashboard 0.4.61 → 0.4.208

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (133) hide show
  1. package/.prettierrc +1 -27
  2. package/.vscode/extensions.json +1 -1
  3. package/README.md +79 -43
  4. package/backend/api.js +48 -40
  5. package/backend/auth.js +3 -3
  6. package/backend/batching.js +1 -1
  7. package/backend/endpoints.js +77 -13
  8. package/backend/index.js +2 -2
  9. package/backend/mock-data.js +38 -29
  10. package/backend/mock-src/classes/logger.js +8 -8
  11. package/backend/mock-src/classes/utils.js +3 -7
  12. package/backend/mock-src/database.js +0 -0
  13. package/backend/mock-src/ticketmaster.js +79 -79
  14. package/backend/validator.js +2 -2
  15. package/config/configs.json +3 -2
  16. package/config/filter.json +3 -2
  17. package/index.html +10 -81
  18. package/index.js +1 -1
  19. package/package.json +25 -40
  20. package/postcss.config.js +1 -1
  21. package/postinstall.js +17 -98
  22. package/public/android-chrome-192x192.png +0 -0
  23. package/public/android-chrome-512x512.png +0 -0
  24. package/public/apple-touch-icon.png +0 -0
  25. package/public/favicon-16x16.png +0 -0
  26. package/public/favicon-32x32.png +0 -0
  27. package/public/favicon.ico +0 -0
  28. package/public/manifest.json +7 -12
  29. package/public/sw.js +2 -0
  30. package/public/workbox-49fdaf31.js +2 -0
  31. package/public/workbox-49fdaf31.js.map +1 -0
  32. package/public/workbox-88575b92.js +2 -0
  33. package/public/workbox-88575b92.js.map +1 -0
  34. package/public/workbox-a67a7b11.js +2 -0
  35. package/public/workbox-a67a7b11.js.map +1 -0
  36. package/public/workbox-d4314735.js +2 -0
  37. package/public/workbox-d4314735.js.map +1 -0
  38. package/public/workbox-e0f89ef3.js +2 -0
  39. package/public/workbox-e0f89ef3.js.map +1 -0
  40. package/run +9 -176
  41. package/src/App.vue +85 -498
  42. package/src/assets/css/_input.scss +99 -144
  43. package/src/assets/css/main.scss +99 -450
  44. package/src/assets/img/background.svg +2 -2
  45. package/src/assets/img/logo_icon.png +0 -0
  46. package/src/components/Auth/LoginForm.vue +11 -62
  47. package/src/components/Editors/Account/Account.vue +40 -116
  48. package/src/components/Editors/Account/AccountCreator.vue +39 -88
  49. package/src/components/Editors/Account/AccountView.vue +34 -102
  50. package/src/components/Editors/Account/CreateAccount.vue +32 -80
  51. package/src/components/Editors/Profile/CreateProfile.vue +83 -269
  52. package/src/components/Editors/Profile/Profile.vue +47 -132
  53. package/src/components/Editors/Profile/ProfileCountryChooser.vue +20 -82
  54. package/src/components/Editors/Profile/ProfileView.vue +34 -91
  55. package/src/components/Editors/TagLabel.vue +6 -67
  56. package/src/components/Filter/Filter.vue +72 -289
  57. package/src/components/Filter/FilterPreview.vue +30 -171
  58. package/src/components/Filter/PriceSortToggle.vue +4 -74
  59. package/src/components/Table/Header.vue +1 -1
  60. package/src/components/Table/Row.vue +1 -1
  61. package/src/components/Table/Table.vue +2 -19
  62. package/src/components/Tasks/CheckStock.vue +13 -28
  63. package/src/components/Tasks/Controls/DesktopControls.vue +17 -17
  64. package/src/components/Tasks/Controls/MobileControls.vue +45 -8
  65. package/src/components/Tasks/CreateTaskAXS.vue +73 -79
  66. package/src/components/Tasks/CreateTaskTM.vue +142 -94
  67. package/src/components/Tasks/MassEdit.vue +7 -9
  68. package/src/components/Tasks/QuickSettings.vue +55 -169
  69. package/src/components/Tasks/ScrapeVenue.vue +4 -7
  70. package/src/components/Tasks/Stats.vue +23 -52
  71. package/src/components/Tasks/Task.vue +136 -378
  72. package/src/components/Tasks/TaskView.vue +47 -107
  73. package/src/components/Tasks/Utilities.vue +6 -5
  74. package/src/components/icons/Bag.vue +1 -1
  75. package/src/components/icons/Loyalty.vue +1 -1
  76. package/src/components/icons/Mail.vue +2 -2
  77. package/src/components/icons/Play.vue +2 -2
  78. package/src/components/icons/Reload.vue +5 -4
  79. package/src/components/icons/Sandclock.vue +2 -2
  80. package/src/components/icons/Stadium.vue +1 -1
  81. package/src/components/icons/index.js +1 -24
  82. package/src/components/ui/Modal.vue +13 -105
  83. package/src/components/ui/Navbar.vue +38 -171
  84. package/src/components/ui/ReconnectIndicator.vue +55 -351
  85. package/src/components/ui/Splash.vue +35 -5
  86. package/src/components/ui/controls/CountryChooser.vue +62 -200
  87. package/src/components/ui/controls/atomic/Checkbox.vue +10 -119
  88. package/src/components/ui/controls/atomic/Dropdown.vue +39 -208
  89. package/src/components/ui/controls/atomic/MultiDropdown.vue +37 -300
  90. package/src/libs/Filter.js +170 -200
  91. package/src/registerServiceWorker.js +1 -1
  92. package/src/stores/connection.js +53 -51
  93. package/src/stores/logger.js +3 -11
  94. package/src/stores/sampleData.js +235 -207
  95. package/src/stores/ui.js +44 -112
  96. package/src/stores/utils.js +6 -90
  97. package/src/views/Accounts.vue +35 -44
  98. package/src/views/Console.vue +90 -341
  99. package/src/views/Editor.vue +123 -1176
  100. package/src/views/FilterBuilder.vue +251 -607
  101. package/src/views/Login.vue +14 -76
  102. package/src/views/Profiles.vue +25 -44
  103. package/src/views/Tasks.vue +100 -187
  104. package/static/offline.html +50 -192
  105. package/tailwind.config.js +26 -104
  106. package/vite.config.js +16 -73
  107. package/vue.config.js +32 -0
  108. package/workbox-config.js +11 -0
  109. package/artwork/image.png +0 -0
  110. package/dev-server.js +0 -136
  111. package/exit +0 -209
  112. package/jsconfig.json +0 -16
  113. package/src/assets/css/_utilities.scss +0 -388
  114. package/src/assets/img/background.svg.backup +0 -11
  115. package/src/components/icons/Check.vue +0 -5
  116. package/src/components/icons/Close.vue +0 -21
  117. package/src/components/icons/CloseX.vue +0 -5
  118. package/src/components/icons/Key.vue +0 -21
  119. package/src/components/icons/Pencil.vue +0 -21
  120. package/src/components/icons/Profile.vue +0 -18
  121. package/src/components/icons/Sell.vue +0 -21
  122. package/src/components/icons/Spinner.vue +0 -42
  123. package/src/components/icons/SquareCheck.vue +0 -18
  124. package/src/components/icons/SquareUncheck.vue +0 -18
  125. package/src/components/icons/Wildcard.vue +0 -18
  126. package/src/components/ui/controls/atomic/LoadingButton.vue +0 -45
  127. package/src/composables/useClickOutside.js +0 -21
  128. package/src/composables/useDropdownPosition.js +0 -174
  129. package/src/types/index.js +0 -41
  130. package/src/utils/debug.js +0 -1
  131. package/switch-branch.sh +0 -41
  132. package/workbox-config.cjs +0 -63
  133. /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
  }
@@ -1,3 +1,3 @@
1
1
  {
2
- "recommendations": ["Vue.volar", "esbenp.prettier-vscode"]
2
+ "recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"]
3
3
  }
package/README.md CHANGED
@@ -1,65 +1,101 @@
1
- <div align="center">
2
- <img src="./artwork/image.png" alt="Dashboard" width="400">
3
- </div>
1
+ # russonoro
4
2
 
5
- # 🎫 Dashboard
3
+ This template should help get you started developing with Vue 3 in Vite.
6
4
 
7
- A sophisticated PWA dashboard for managing ticket purchasing automation across multiple platforms. Built with Vue 3 and real-time WebSocket communication.
5
+ ## Recommended IDE Setup
8
6
 
9
- ## Quick Start
7
+ [VSCode](https://code.visualstudio.com/) + [Volar](https://marketplace.visualstudio.com/items?itemName=Vue.volar) (and disable Vetur) + [TypeScript Vue Plugin (Volar)](https://marketplace.visualstudio.com/items?itemName=Vue.vscode-typescript-vue-plugin).
10
8
 
11
- ```bash
9
+ ## Customize configuration
10
+
11
+ See [Vite Configuration Reference](https://vitejs.dev/config/).
12
+
13
+ ## Project Setup
14
+
15
+ ```sh
12
16
  npm install
17
+ ```
18
+
19
+ ### Compile and Hot-Reload for Development
20
+
21
+ ```sh
13
22
  npm run dev
14
23
  ```
15
24
 
16
- Visit `http://localhost:5173` and you're live.
25
+ ### Compile and Minify for Production
17
26
 
18
- ## 🚀 Commands
27
+ ```sh
28
+ npm run build
29
+ ```
19
30
 
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 |
31
+ ## Filter stuff
26
32
 
27
- ### 🧱 Frontend Stack
33
+ All filter types can have the following fields:
28
34
 
29
- - Vue 3 + Composition API
30
- - Pinia state management
31
- - TailwindCSS + SCSS
32
- - PWA with offline support
35
+ - eventId: "ABCDEF123456789" (eventId that the filter will apply too)
36
+ - priceSort: "asc|desc|null" (order of tickets that will be carted)
37
+ - maxPrice: 100 (max price of tickets)
38
+ - minPrice: 0 (min price of tickets)
39
+ - exclude: true|false (is excluded)
33
40
 
34
- ### 🛠 Backend Stack
41
+ ### Standard
35
42
 
36
- - Express.js with WebSockets
37
- - MessagePack serialization
38
- - Real-time message batching
39
- - Platform abstraction layer
43
+ ```json
44
+ {
45
+ "section": "205",
46
+ "rows": ["A", "B", "D"]
47
+ }
48
+ ```
40
49
 
41
- ## 📱 PWA Support
50
+ ### First row
42
51
 
43
- - 📲 Install to home screen
44
- - 🔄 Background sync
45
- - 📶 Offline functionality
46
- - 🎨 Native app feel
52
+ Shorthand for the standard filter, that will only include the first row of the section
47
53
 
48
- ## 🛠️ Development
54
+ ```json
55
+ {
56
+ "section": "205",
57
+ "firstRow": true
58
+ }
59
+ ```
49
60
 
50
- Runs in mock mode by default. Backend simulates bot operations; frontend provides full UI functionality.
61
+ ### First-Row Catch-All
62
+
63
+ ```json
64
+ {
65
+ "buyAny": true,
66
+ "firstRow": true,
67
+ }
68
+ // same
69
+ {
70
+ "firstRow": true,
71
+ }
72
+ ```
51
73
 
52
- ### 🗂️ File Structure
74
+ ### Catch-All
53
75
 
76
+ ```json
77
+ {
78
+ "buyAny": true
79
+ }
54
80
  ```
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
81
+
82
+ ### GA Catch-all
83
+
84
+ ```json
85
+ {
86
+ "generalAdmission": true
87
+ }
65
88
  ```
89
+
90
+ - [x] Blacklist toggle
91
+ - [x] Blacklist checkmark on each filter
92
+ - [x] Highlight excluded rows/secs in the map
93
+ - [x] Container with border for the map
94
+ - [x] Toggle for showing only blacklist/all/whitelist
95
+ - [x] Zoom in/out & reset buttons like on TM
96
+ - [x] Implement new firstRow mechanic
97
+ - [x] Optimize map
98
+ - [x] Drag/Drop with mouse to select rows
99
+ - [ ] Use icons everywhere
100
+ - [ ] Use textbox/buttons from task creator
101
+ - [x] Support GA sections correctly (I think correct)
package/backend/api.js CHANGED
@@ -1,22 +1,19 @@
1
- import enableWs from "express-ws";
2
- import express from "express";
3
- import cors from "cors";
4
- import cookieParser from "cookie-parser";
5
- import { encode } from "@msgpack/msgpack";
6
- import fs from "node:fs";
7
- import path from "node:path";
8
- import { fileURLToPath } from "node:url";
9
-
10
- const __filename = fileURLToPath(import.meta.url);
11
- const __dirname = path.dirname(__filename);
12
-
13
- import { createLogger } from "./mock-src/classes/logger.js";
14
- import utils from "./mock-src/classes/utils.js";
15
-
16
- import Batcher from "./batching.js";
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 = utils.uuid();
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, version: "1.0" });
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
- ...Bot.ConsoleBuffer[c]
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.Info("Proxied", url, response.status);
385
+ logger.info("Proxied", {
386
+ url,
387
+ status: response.status,
388
+ contentType,
389
+ size: data.length
390
+ });
370
391
  } catch (error) {
371
- logger.Error("Proxy error", { url, error: error.message });
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({ CapSolver: 100, TwoCaptcha: 40 });
432
+ return res.send({ capsolver: "$10", hyper: "$40" });
425
433
  });
426
434
 
427
- export default {
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
- import crypto from "node:crypto";
1
+ const uuid = require("uuid").v4;
2
2
 
3
3
  const generateAuthToken = () => {
4
- return crypto.randomUUID();
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
- export default Auth;
62
+ module.exports = Auth;
@@ -40,4 +40,4 @@ class Batcher {
40
40
  }
41
41
  }
42
42
 
43
- export default Batcher;
43
+ module.exports = Batcher;
@@ -1,8 +1,8 @@
1
- import { createLogger } from "./mock-src/classes/logger.js";
2
- import TicketMaster from "./mock-src/ticketmaster.js";
3
- import utils from "./mock-src/classes/utils.js";
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
- import validateTaskData from "./validator.js";
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])
@@ -127,7 +166,7 @@ const addTask = async (data) => {
127
166
 
128
167
  var taskObj = new TicketMaster(task);
129
168
  taskObj.data.openerLink =
130
- "necro://eyJzbHVnIjoiaHRKQnR1aTRMMzFmU3BtaVVDQngiLCJjb25maWciOnsib3ZlcndyaXRlUHJveHkiOm51bGwsImRlYnVnIjp0cnVlfX0=";
169
+ "russonoro://eyJzbHVnIjoiaHRKQnR1aTRMMzFmU3BtaVVDQngiLCJjb25maWciOnsib3ZlcndyaXRlUHJveHkiOm51bGwsImRlYnVnIjp0cnVlfX0=";
131
170
  taskObj.data.siteId = data.siteId;
132
171
 
133
172
  // if (!Object.values(Bot.Tasks).find((t) => t.email == taskObj.email))
@@ -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 { id } = profile;
276
- Bot.Profiles = Bot.Profiles.filter((p) => p.id !== profile.id);
277
- pushWSUpdate({ event: "delete-profile", profile: { id } });
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/get":
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
- export default {
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
- import { users, profiles, tmAccounts, axsAccounts } from "./mock-data.js";
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
- export { default } from "./api.js";
23
+ module.exports = require("./api");
@@ -1,21 +1,29 @@
1
1
  const users = [
2
2
  {
3
3
  event: "auth",
4
- id: "641a5292b561088b64fe390b",
5
- name: "Admin",
6
- password: "admin",
7
- profilePicture: "https://cdn.discordapp.com/avatars/435549216304267264/6cfd74ad7c5939a0bcbf218aa08be8cb.png",
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", "Slash"],
11
- tags: ["admin"]
18
+ profileTags: ["Amex", "Citi", "Mercury", "CapOne", "Veridian", "WIO", "Kez", "Xpence"],
19
+ accountTags: ["russonoro", "paolo", "dubai"]
12
20
  }
13
21
  ];
14
22
 
15
23
  const profile = {
16
- id: "645a82606ef8b7201b728805",
24
+ _id: "645a82606ef8b7201b728805",
17
25
  enabled: false,
18
- profileName: "Master US 43725 [admin]",
26
+ profileName: "Master US 43725 [RUSSONORO]",
19
27
  address: "88081 Piper Ways",
20
28
  city: "Gilbert",
21
29
  state: "MN",
@@ -27,31 +35,32 @@ const profile = {
27
35
  cvv: "136",
28
36
  totalSpent: 905.75,
29
37
  orders: ["sandersonsandezomar1239@gmail.com - 35-57435/NCA - 1C005E7E94D81D8A - 1684344138367 - Melanie Martinez"],
30
- tags: ["admin", "master", "slash"],
38
+ tags: ["russonoro", "master", "slash"],
31
39
  checkouts: 1,
32
40
  declines: 0,
33
41
  createdBy: "admin"
34
42
  };
35
43
 
36
44
  const profiles = [];
37
- for (let i = 0; i < 1000; i++) profiles.push({ ...profile, id: i });
45
+ for (let i = 0; i < 1000; i++) profiles.push({ ...profile, _id: i });
38
46
 
39
- export { users, profiles };
40
-
41
- export const tmAccounts = [
42
- {
43
- tags: ["admin"],
44
- id: 1,
45
- password: "123",
46
- email: "tm@tm.com"
47
- }
48
- ];
49
-
50
- export const axsAccounts = [
51
- {
52
- tags: ["admin"],
53
- id: 2,
54
- password: "123",
55
- email: "axs@axs.com"
56
- }
57
- ];
47
+ module.exports = {
48
+ users,
49
+ profiles,
50
+ tmAccounts: [
51
+ {
52
+ tags: ["russonoro"],
53
+ _id: 1,
54
+ password: "123",
55
+ email: "tm@tm.com"
56
+ }
57
+ ],
58
+ axsAccounts: [
59
+ {
60
+ tags: ["russonoro"],
61
+ _id: 2,
62
+ password: "123",
63
+ email: "axs@axs.com"
64
+ }
65
+ ]
66
+ };
@@ -1,4 +1,4 @@
1
- import util from "node:util";
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
- export const createLogger = (args) => {
107
- const logger = new Logger();
108
- logger.defaultArgs = typeof args == "string" ? [args] : typeof args == "object" ? args : undefined;
109
- return logger;
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
  };