@necrolab/dashboard 0.4.3
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/.claude/settings.local.json +45 -0
- package/.eslintrc.js +24 -0
- package/.prettierignore +1 -0
- package/.prettierrc +10 -0
- package/.vscode/extensions.json +3 -0
- package/ICONS.md +21 -0
- package/README.md +65 -0
- package/backend/api.js +430 -0
- package/backend/auth.js +62 -0
- package/backend/batching.js +43 -0
- package/backend/endpoints.js +343 -0
- package/backend/index.js +23 -0
- package/backend/mock-data.js +66 -0
- package/backend/mock-src/classes/logger.js +112 -0
- package/backend/mock-src/classes/utils.js +42 -0
- package/backend/mock-src/ticketmaster.js +92 -0
- package/backend/validator.js +62 -0
- package/config/configs.json +20 -0
- package/config/filter.json +3 -0
- package/config/presale.csv +3 -0
- package/config/proxies.txt +6 -0
- package/config/used-codes.json +4 -0
- package/index.html +114 -0
- package/index.js +2 -0
- package/jsconfig.json +16 -0
- package/package.json +48 -0
- package/postcss.config.js +6 -0
- package/postinstall.js +9 -0
- 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/flags/ae.svg +1 -0
- package/public/flags/at.svg +1 -0
- package/public/flags/au.svg +1 -0
- package/public/flags/be.svg +1 -0
- package/public/flags/ch.svg +1 -0
- package/public/flags/cz.svg +1 -0
- package/public/flags/de.svg +1 -0
- package/public/flags/dk.svg +1 -0
- package/public/flags/es.svg +1 -0
- package/public/flags/nl.svg +1 -0
- package/public/flags/no.svg +1 -0
- package/public/flags/nz.svg +1 -0
- package/public/flags/pl.svg +1 -0
- package/public/flags/se.svg +1 -0
- package/public/flags/uk.svg +1 -0
- package/public/flags/us.svg +1 -0
- package/public/img/award.svg +3 -0
- package/public/img/background.svg +14 -0
- package/public/img/bag_w.svg +12 -0
- package/public/img/banks/amex.svg +4 -0
- package/public/img/banks/mastercard.svg +4 -0
- package/public/img/banks/visa.svg +4 -0
- package/public/img/camera.svg +3 -0
- package/public/img/close.svg +3 -0
- package/public/img/controls/disable.svg +5 -0
- package/public/img/controls/enable.svg +5 -0
- package/public/img/groups.svg +3 -0
- package/public/img/hand.svg +3 -0
- package/public/img/key.svg +3 -0
- package/public/img/logo.png +0 -0
- package/public/img/logo_icon.png +0 -0
- package/public/img/logo_icon_2.png +0 -0
- package/public/img/logo_trans.png +0 -0
- package/public/img/loyalty.svg +3 -0
- package/public/img/mail.svg +3 -0
- package/public/img/pencil.svg +3 -0
- package/public/img/profile.svg +4 -0
- package/public/img/reload.svg +3 -0
- package/public/img/sandclock.svg +25 -0
- package/public/img/save.svg +5 -0
- package/public/img/savings.svg +3 -0
- package/public/img/scanner.svg +3 -0
- package/public/img/sell.svg +3 -0
- package/public/img/shield.svg +3 -0
- package/public/img/ski.svg +3 -0
- package/public/img/stadium.svg +8 -0
- package/public/img/stadium_w.svg +8 -0
- package/public/img/timer.svg +3 -0
- package/public/manifest.json +27 -0
- package/public/robots.txt +2 -0
- package/run +10 -0
- package/src/App.vue +307 -0
- package/src/assets/css/_input.scss +197 -0
- package/src/assets/css/main.scss +269 -0
- package/src/assets/css/tailwind.css +3 -0
- package/src/assets/img/award.svg +3 -0
- package/src/assets/img/background.svg +11 -0
- package/src/assets/img/camera.svg +3 -0
- package/src/assets/img/close.svg +3 -0
- package/src/assets/img/eyes/closed.svg +13 -0
- package/src/assets/img/eyes/open.svg +12 -0
- package/src/assets/img/groups.svg +3 -0
- package/src/assets/img/hand.svg +3 -0
- package/src/assets/img/key.svg +3 -0
- package/src/assets/img/logo.png +0 -0
- package/src/assets/img/logo_icon.png +0 -0
- package/src/assets/img/logo_icon_2.png +0 -0
- package/src/assets/img/logo_trans.png +0 -0
- package/src/assets/img/loyalty.svg +3 -0
- package/src/assets/img/mail.svg +3 -0
- package/src/assets/img/pencil.svg +3 -0
- package/src/assets/img/reload.svg +3 -0
- package/src/assets/img/savings.svg +3 -0
- package/src/assets/img/scanner.svg +3 -0
- package/src/assets/img/sell.svg +3 -0
- package/src/assets/img/shield.svg +3 -0
- package/src/assets/img/ski.svg +3 -0
- package/src/assets/img/square_check.svg +5 -0
- package/src/assets/img/square_uncheck.svg +5 -0
- package/src/assets/img/stadium.svg +8 -0
- package/src/assets/img/timer.svg +3 -0
- package/src/assets/img/wildcard.svg +7 -0
- package/src/components/Auth/LoginForm.vue +48 -0
- package/src/components/Editors/Account/Account.vue +119 -0
- package/src/components/Editors/Account/AccountCreator.vue +147 -0
- package/src/components/Editors/Account/AccountView.vue +87 -0
- package/src/components/Editors/Account/CreateAccount.vue +106 -0
- package/src/components/Editors/Profile/CreateProfile.vue +321 -0
- package/src/components/Editors/Profile/Profile.vue +142 -0
- package/src/components/Editors/Profile/ProfileCountryChooser.vue +75 -0
- package/src/components/Editors/Profile/ProfileView.vue +96 -0
- package/src/components/Editors/TagLabel.vue +16 -0
- package/src/components/Editors/TagToggle.vue +41 -0
- package/src/components/Filter/Filter.vue +409 -0
- package/src/components/Filter/FilterPreview.vue +236 -0
- package/src/components/Filter/PriceSortToggle.vue +105 -0
- package/src/components/Table/Header.vue +5 -0
- package/src/components/Table/Row.vue +5 -0
- package/src/components/Table/Table.vue +14 -0
- package/src/components/Table/index.js +4 -0
- package/src/components/Tasks/CheckStock.vue +62 -0
- package/src/components/Tasks/Controls/DesktopControls.vue +73 -0
- package/src/components/Tasks/Controls/MobileControls.vue +32 -0
- package/src/components/Tasks/Controls/index.js +3 -0
- package/src/components/Tasks/CreateTaskAXS.vue +339 -0
- package/src/components/Tasks/CreateTaskTM.vue +459 -0
- package/src/components/Tasks/MassEdit.vue +50 -0
- package/src/components/Tasks/QuickSettings.vue +167 -0
- package/src/components/Tasks/ScrapeVenue.vue +42 -0
- package/src/components/Tasks/Stats.vue +66 -0
- package/src/components/Tasks/Task.vue +296 -0
- package/src/components/Tasks/TaskLabel.vue +20 -0
- package/src/components/Tasks/TaskView.vue +126 -0
- package/src/components/Tasks/Utilities.vue +33 -0
- package/src/components/icons/Award.vue +8 -0
- package/src/components/icons/Bag.vue +8 -0
- package/src/components/icons/BagWhite.vue +8 -0
- package/src/components/icons/Box.vue +8 -0
- package/src/components/icons/Camera.vue +8 -0
- package/src/components/icons/Cart.vue +8 -0
- package/src/components/icons/Check.vue +5 -0
- package/src/components/icons/Checkmark.vue +11 -0
- package/src/components/icons/Click.vue +8 -0
- package/src/components/icons/Close.vue +21 -0
- package/src/components/icons/CloseX.vue +5 -0
- package/src/components/icons/Console.vue +13 -0
- package/src/components/icons/Down.vue +8 -0
- package/src/components/icons/Edit.vue +13 -0
- package/src/components/icons/Event.vue +8 -0
- package/src/components/icons/Expand.vue +8 -0
- package/src/components/icons/Filter.vue +13 -0
- package/src/components/icons/Gear.vue +8 -0
- package/src/components/icons/Group.vue +8 -0
- package/src/components/icons/Hand.vue +8 -0
- package/src/components/icons/Key.vue +21 -0
- package/src/components/icons/Logout.vue +13 -0
- package/src/components/icons/Loyalty.vue +8 -0
- package/src/components/icons/Mail.vue +8 -0
- package/src/components/icons/Menu.vue +8 -0
- package/src/components/icons/Pause.vue +5 -0
- package/src/components/icons/Pencil.vue +21 -0
- package/src/components/icons/Play.vue +8 -0
- package/src/components/icons/Plus.vue +8 -0
- package/src/components/icons/Profile.vue +18 -0
- package/src/components/icons/Reload.vue +7 -0
- package/src/components/icons/Sandclock.vue +33 -0
- package/src/components/icons/Savings.vue +8 -0
- package/src/components/icons/Scanner.vue +8 -0
- package/src/components/icons/Scrape.vue +8 -0
- package/src/components/icons/Sell.vue +21 -0
- package/src/components/icons/Shield.vue +8 -0
- package/src/components/icons/Shrink.vue +8 -0
- package/src/components/icons/Ski.vue +8 -0
- package/src/components/icons/Spinner.vue +42 -0
- package/src/components/icons/SquareCheck.vue +18 -0
- package/src/components/icons/SquareUncheck.vue +18 -0
- package/src/components/icons/Stadium.vue +13 -0
- package/src/components/icons/StadiumWhite.vue +13 -0
- package/src/components/icons/Status.vue +8 -0
- package/src/components/icons/Tag.vue +8 -0
- package/src/components/icons/Tasks.vue +13 -0
- package/src/components/icons/Ticket.vue +8 -0
- package/src/components/icons/Timer.vue +8 -0
- package/src/components/icons/Trash.vue +8 -0
- package/src/components/icons/Up.vue +10 -0
- package/src/components/icons/Wildcard.vue +18 -0
- package/src/components/icons/index.js +111 -0
- package/src/components/ui/Modal.vue +61 -0
- package/src/components/ui/Navbar.vue +207 -0
- package/src/components/ui/ReconnectIndicator.vue +90 -0
- package/src/components/ui/Splash.vue +24 -0
- package/src/components/ui/controls/CountryChooser.vue +87 -0
- package/src/components/ui/controls/EyeToggle.vue +11 -0
- package/src/components/ui/controls/atomic/Checkbox.vue +28 -0
- package/src/components/ui/controls/atomic/Dropdown.vue +138 -0
- package/src/components/ui/controls/atomic/LoadingButton.vue +45 -0
- package/src/components/ui/controls/atomic/MultiDropdown.vue +262 -0
- package/src/components/ui/controls/atomic/Switch.vue +84 -0
- package/src/libs/Filter.js +593 -0
- package/src/libs/ansii.js +565 -0
- package/src/libs/panzoom.js +1413 -0
- package/src/main.js +23 -0
- package/src/registerServiceWorker.js +32 -0
- package/src/router/index.js +65 -0
- package/src/stores/cities.json +1 -0
- package/src/stores/connection.js +399 -0
- package/src/stores/countries.js +88 -0
- package/src/stores/logger.js +103 -0
- package/src/stores/requests.js +88 -0
- package/src/stores/sampleData.js +1034 -0
- package/src/stores/ui.js +584 -0
- package/src/stores/utils.js +554 -0
- package/src/types/index.js +42 -0
- package/src/utils/debug.js +1 -0
- package/src/views/Accounts.vue +191 -0
- package/src/views/Console.vue +224 -0
- package/src/views/Editor.vue +785 -0
- package/src/views/FilterBuilder.vue +785 -0
- package/src/views/Login.vue +27 -0
- package/src/views/Profiles.vue +209 -0
- package/src/views/Tasks.vue +157 -0
- package/static/offline.html +184 -0
- package/tailwind.config.js +57 -0
- package/vite.config.js +63 -0
- package/vue.config.js +32 -0
- package/workbox-config.js +66 -0
|
@@ -0,0 +1,399 @@
|
|
|
1
|
+
import { useUIStore } from "@/stores/ui";
|
|
2
|
+
import WebsocketHeartbeatJs from "websocket-heartbeat-js";
|
|
3
|
+
import { decode } from "@msgpack/msgpack";
|
|
4
|
+
import router from "@/router/index";
|
|
5
|
+
import { sortTaskIds } from "@/stores/utils";
|
|
6
|
+
|
|
7
|
+
export class ConnectionHandler {
|
|
8
|
+
handleWebsocketMessages(msg) {
|
|
9
|
+
switch (msg.event) {
|
|
10
|
+
case "startup":
|
|
11
|
+
if (msg.done) {
|
|
12
|
+
this.ui.hideSpinner();
|
|
13
|
+
this.ui.setBotVersion(msg.version || "-");
|
|
14
|
+
} else this.ui.startSpinner(msg.message || "Starting Bot");
|
|
15
|
+
break;
|
|
16
|
+
|
|
17
|
+
case "stop-all":
|
|
18
|
+
for (const value of Object.values(this.ui.tasks)) {
|
|
19
|
+
value.active = false;
|
|
20
|
+
}
|
|
21
|
+
this.ui.showSuccess("Stopped all tasks!");
|
|
22
|
+
break;
|
|
23
|
+
|
|
24
|
+
case "start-all":
|
|
25
|
+
for (const value of Object.values(this.ui.tasks)) {
|
|
26
|
+
value.active = true;
|
|
27
|
+
}
|
|
28
|
+
this.ui.showSuccess("Started all tasks!");
|
|
29
|
+
break;
|
|
30
|
+
|
|
31
|
+
case "delete-all":
|
|
32
|
+
this.ui.tasks = {};
|
|
33
|
+
this.ui.taskIdOrder = [];
|
|
34
|
+
this.ui.showSuccess("Deleted all tasks!");
|
|
35
|
+
break;
|
|
36
|
+
|
|
37
|
+
case "init-tasks":
|
|
38
|
+
var oldOrder = [...this.ui.taskIdOrder];
|
|
39
|
+
this.ui.tasks = msg.tasks;
|
|
40
|
+
var newIds = Object.keys(msg.tasks);
|
|
41
|
+
|
|
42
|
+
var existingIds = oldOrder.filter((id) => newIds.includes(id));
|
|
43
|
+
var missingTaskIds = newIds.filter((id) => !oldOrder.includes(id));
|
|
44
|
+
missingTaskIds.sort(sortTaskIds);
|
|
45
|
+
|
|
46
|
+
this.ui.taskIdOrder = [...existingIds, ...missingTaskIds];
|
|
47
|
+
this.ui.refreshQueueStats();
|
|
48
|
+
this.ui.hideSpinner();
|
|
49
|
+
break;
|
|
50
|
+
|
|
51
|
+
case "init-profiles":
|
|
52
|
+
this.ui.setProfiles(msg.profiles);
|
|
53
|
+
this.ui.hideSpinner();
|
|
54
|
+
break;
|
|
55
|
+
|
|
56
|
+
case "init-proxies":
|
|
57
|
+
this.ui.setProxies(msg.proxies);
|
|
58
|
+
this.ui.hideSpinner();
|
|
59
|
+
break;
|
|
60
|
+
|
|
61
|
+
case "init-tm-accounts":
|
|
62
|
+
this.ui.setAccounts(msg.accounts.map((acc) => ({ ...acc, module: "TM" })));
|
|
63
|
+
this.ui.hideSpinner();
|
|
64
|
+
break;
|
|
65
|
+
|
|
66
|
+
case "init-axs-accounts":
|
|
67
|
+
this.ui.setAccounts(msg.accounts.map((acc) => ({ ...acc, module: "AXS" })));
|
|
68
|
+
this.ui.hideSpinner();
|
|
69
|
+
break;
|
|
70
|
+
|
|
71
|
+
case "add-task":
|
|
72
|
+
this.ui.tasks[msg.task.taskId] = msg.task;
|
|
73
|
+
|
|
74
|
+
if (!this.ui.taskIdOrder.includes(msg.task.taskId)) {
|
|
75
|
+
let pos = this.ui.taskIdOrder.length;
|
|
76
|
+
for (let i = 0; i < this.ui.taskIdOrder.length; i++) {
|
|
77
|
+
if (sortTaskIds(msg.task.taskId, this.ui.taskIdOrder[i]) < 0) {
|
|
78
|
+
pos = i;
|
|
79
|
+
break;
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
this.ui.taskIdOrder.splice(pos, 0, msg.task.taskId);
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
this.ui.toggleSort();
|
|
86
|
+
this.ui.showSuccess("Created 1 task!");
|
|
87
|
+
this.ui.refreshQueueStats();
|
|
88
|
+
break;
|
|
89
|
+
|
|
90
|
+
case "add-tasks":
|
|
91
|
+
var batchTaskIds = Object.keys(msg.tasks).sort(sortTaskIds);
|
|
92
|
+
|
|
93
|
+
for (const id of batchTaskIds) {
|
|
94
|
+
const value = msg.tasks[id];
|
|
95
|
+
this.ui.tasks[id] = value;
|
|
96
|
+
|
|
97
|
+
if (!this.ui.taskIdOrder.includes(id)) {
|
|
98
|
+
let pos = this.ui.taskIdOrder.length;
|
|
99
|
+
for (let i = 0; i < this.ui.taskIdOrder.length; i++) {
|
|
100
|
+
if (sortTaskIds(id, this.ui.taskIdOrder[i]) < 0) {
|
|
101
|
+
pos = i;
|
|
102
|
+
break;
|
|
103
|
+
}
|
|
104
|
+
}
|
|
105
|
+
this.ui.taskIdOrder.splice(pos, 0, id);
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
this.ui.showSuccess(`Created ${batchTaskIds.length} tasks!`);
|
|
109
|
+
this.ui.refreshQueueStats();
|
|
110
|
+
break;
|
|
111
|
+
|
|
112
|
+
case "task-update":
|
|
113
|
+
case "task-setstatus":
|
|
114
|
+
case "task-setinfo":
|
|
115
|
+
if (msg?.task?.removed) {
|
|
116
|
+
delete this.ui.tasks[msg.id];
|
|
117
|
+
this.ui.taskIdOrder = this.ui.taskIdOrder.filter((i) => i !== msg.id);
|
|
118
|
+
} else if (msg.update) {
|
|
119
|
+
try {
|
|
120
|
+
Object.entries(msg.update).forEach((change) => (this.ui.tasks[msg.id][change[0]] = change[1]));
|
|
121
|
+
// eslint-disable-next-line no-empty
|
|
122
|
+
} catch {}
|
|
123
|
+
} else {
|
|
124
|
+
if (!this.ui.tasks[msg.id]) this.ui.tasks[msg.id] = msg.task;
|
|
125
|
+
if (!this.ui.taskIdOrder.includes(msg.id)) {
|
|
126
|
+
this.ui.taskIdOrder.push(msg.id);
|
|
127
|
+
this.ui.sortTasks();
|
|
128
|
+
} else
|
|
129
|
+
Object.keys(msg.task).forEach((key) => {
|
|
130
|
+
this.ui.tasks[msg.id][key] = msg.task[key];
|
|
131
|
+
});
|
|
132
|
+
}
|
|
133
|
+
this.ui.refreshQueueStats();
|
|
134
|
+
break;
|
|
135
|
+
|
|
136
|
+
case "edit-presale-code":
|
|
137
|
+
for (const value of Object.values(this.ui.tasks)) {
|
|
138
|
+
if (value.eventId === msg.data.eventId) {
|
|
139
|
+
value.presaleCode = msg.data.presaleCode;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
this.ui.showSuccess("Updated presale code!");
|
|
143
|
+
break;
|
|
144
|
+
|
|
145
|
+
case "login":
|
|
146
|
+
this.ui.hideSpinner();
|
|
147
|
+
router.push("/login");
|
|
148
|
+
break;
|
|
149
|
+
|
|
150
|
+
case "auth":
|
|
151
|
+
// redirect to / if on login page, but successfully logged in
|
|
152
|
+
if (router.currentRoute.value.name === "login") router.push("/");
|
|
153
|
+
this.ui.setProfile(msg);
|
|
154
|
+
break;
|
|
155
|
+
|
|
156
|
+
case "error":
|
|
157
|
+
this.ui.showError(msg.msg);
|
|
158
|
+
break;
|
|
159
|
+
|
|
160
|
+
case "set-button-disabled": {
|
|
161
|
+
const { button, value } = msg;
|
|
162
|
+
this.ui.disabledButtons[button] = value;
|
|
163
|
+
break;
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
case "add-account": {
|
|
167
|
+
const exists = this.ui.accounts.findIndex((p) => p._id === msg.account._id);
|
|
168
|
+
if (exists !== -1) {
|
|
169
|
+
Object.keys(msg.account).forEach((k) => (this.ui.accounts[exists][k] = msg.account[k]));
|
|
170
|
+
} else this.ui.accounts.push(msg.account);
|
|
171
|
+
break;
|
|
172
|
+
}
|
|
173
|
+
|
|
174
|
+
case "add-profile": {
|
|
175
|
+
const exists = this.ui.profiles.findIndex((p) => p._id === msg.profile._id);
|
|
176
|
+
if (exists !== -1) {
|
|
177
|
+
Object.keys(msg.profile).forEach((k) => (this.ui.profiles[exists][k] = msg.profile[k]));
|
|
178
|
+
} else this.ui.profiles.push(msg.profile);
|
|
179
|
+
break;
|
|
180
|
+
}
|
|
181
|
+
|
|
182
|
+
case "delete-profile":
|
|
183
|
+
this.ui.profiles = this.ui.profiles.filter((p) => p._id !== msg.profile._id);
|
|
184
|
+
break;
|
|
185
|
+
|
|
186
|
+
default:
|
|
187
|
+
this.ui.logger.Error("Unknown message type:", msg.event);
|
|
188
|
+
break;
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
|
|
192
|
+
sendMessage(msg) {
|
|
193
|
+
try {
|
|
194
|
+
if (msg?.data) msg.data.module = this.ui.currentModule;
|
|
195
|
+
this.socket.send(JSON.stringify(msg));
|
|
196
|
+
} catch {
|
|
197
|
+
this.ui.startSpinner("Reconnecting");
|
|
198
|
+
}
|
|
199
|
+
}
|
|
200
|
+
|
|
201
|
+
init(path) {
|
|
202
|
+
this.ui = useUIStore();
|
|
203
|
+
const url = (window.location.protocol === "http:" ? "ws://" : "wss://") + window.location.host + path;
|
|
204
|
+
|
|
205
|
+
this.socket = new WebsocketHeartbeatJs({ url, pingMsg: "ping" });
|
|
206
|
+
|
|
207
|
+
let hasShownDisconnect = false;
|
|
208
|
+
this.socket.onmessage = (event) => {
|
|
209
|
+
if (event.data === "pong") return;
|
|
210
|
+
if (hasShownDisconnect && this.ui.profile?.name) {
|
|
211
|
+
hasShownDisconnect = false;
|
|
212
|
+
}
|
|
213
|
+
|
|
214
|
+
// if event is not json but msgpack encoded, decode it
|
|
215
|
+
if (event.data instanceof Blob || event.data instanceof ArrayBuffer) {
|
|
216
|
+
event.data.arrayBuffer().then((buffer) => {
|
|
217
|
+
const data = decode(new Uint8Array(buffer));
|
|
218
|
+
data.forEach((d) => this.handleWebsocketMessages(d));
|
|
219
|
+
});
|
|
220
|
+
} else JSON.parse(event.data).forEach((e) => this.handleWebsocketMessages(e));
|
|
221
|
+
};
|
|
222
|
+
|
|
223
|
+
this.socket.onclose = () => {
|
|
224
|
+
this.ui.startSpinner("Reconnecting");
|
|
225
|
+
hasShownDisconnect = true;
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
this.socket.onerror = () => {
|
|
229
|
+
this.ui.startSpinner("Reconnecting");
|
|
230
|
+
hasShownDisconnect = true;
|
|
231
|
+
};
|
|
232
|
+
|
|
233
|
+
// this.socket.addEventListener('message', );
|
|
234
|
+
}
|
|
235
|
+
|
|
236
|
+
sendContinueTask(taskId, continueType) {
|
|
237
|
+
this.sendMessage({
|
|
238
|
+
event: "tasks/continue",
|
|
239
|
+
data: {
|
|
240
|
+
id: taskId,
|
|
241
|
+
type: continueType
|
|
242
|
+
}
|
|
243
|
+
});
|
|
244
|
+
}
|
|
245
|
+
|
|
246
|
+
sendTasksChange(taskId) {
|
|
247
|
+
this.sendMessage({
|
|
248
|
+
event: "tasks/change",
|
|
249
|
+
data: {
|
|
250
|
+
id: taskId
|
|
251
|
+
}
|
|
252
|
+
});
|
|
253
|
+
}
|
|
254
|
+
|
|
255
|
+
sendTasksOpen(taskId) {
|
|
256
|
+
this.sendMessage({
|
|
257
|
+
event: "tasks/open",
|
|
258
|
+
data: {
|
|
259
|
+
id: taskId
|
|
260
|
+
}
|
|
261
|
+
});
|
|
262
|
+
}
|
|
263
|
+
|
|
264
|
+
sendDeleteTask(taskId) {
|
|
265
|
+
this.sendMessage({
|
|
266
|
+
event: "tasks/delete",
|
|
267
|
+
data: {
|
|
268
|
+
id: taskId
|
|
269
|
+
}
|
|
270
|
+
});
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
sendGetTasks() {
|
|
274
|
+
this.sendMessage({
|
|
275
|
+
event: "tasks/get",
|
|
276
|
+
data: {}
|
|
277
|
+
});
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
sendStartTask(taskId) {
|
|
281
|
+
this.sendMessage({
|
|
282
|
+
event: "tasks/start",
|
|
283
|
+
data: {
|
|
284
|
+
id: taskId
|
|
285
|
+
}
|
|
286
|
+
});
|
|
287
|
+
}
|
|
288
|
+
|
|
289
|
+
sendStopTask(taskId) {
|
|
290
|
+
this.sendMessage({
|
|
291
|
+
event: "tasks/stop",
|
|
292
|
+
data: {
|
|
293
|
+
id: taskId
|
|
294
|
+
}
|
|
295
|
+
});
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
sendAddTask(task) {
|
|
299
|
+
this.sendMessage({
|
|
300
|
+
event: "tasks/add",
|
|
301
|
+
data: {
|
|
302
|
+
eventId: task.eventId,
|
|
303
|
+
presaleCode: task.presaleCode,
|
|
304
|
+
quantity: task.quantity,
|
|
305
|
+
email: task.email,
|
|
306
|
+
password: task.password,
|
|
307
|
+
proxy: task.proxy,
|
|
308
|
+
manual: Boolean(task.manual),
|
|
309
|
+
doNotPay: Boolean(task.doNotPay),
|
|
310
|
+
quickQueue: Boolean(task.quickQueue),
|
|
311
|
+
otpAccount: Boolean(task.otpAccount),
|
|
312
|
+
presaleMode: Boolean(task.presaleMode),
|
|
313
|
+
presaleStrict: Boolean(task.presaleStrict),
|
|
314
|
+
loginAfterCart: Boolean(task.loginAfterCart),
|
|
315
|
+
smartTimer: Boolean(task.smartTimer),
|
|
316
|
+
agedAccount: Boolean(task.agedAccount),
|
|
317
|
+
accountTag: task.accountTag,
|
|
318
|
+
profileTags: task.profileTags,
|
|
319
|
+
siteId: this.ui.currentCountry.siteId,
|
|
320
|
+
taskQuantity: task.taskQuantity,
|
|
321
|
+
clOrigin: task.clOrigin,
|
|
322
|
+
startOffset: parseInt(task.startOffset) || 0,
|
|
323
|
+
eventDid: task.eventDid
|
|
324
|
+
}
|
|
325
|
+
});
|
|
326
|
+
}
|
|
327
|
+
|
|
328
|
+
sendMassEditPresaleCode(eventId, presaleCode) {
|
|
329
|
+
this.sendMessage({
|
|
330
|
+
event: "mass-edit-presale-code",
|
|
331
|
+
data: {
|
|
332
|
+
eventId: eventId,
|
|
333
|
+
presaleCode: presaleCode
|
|
334
|
+
}
|
|
335
|
+
});
|
|
336
|
+
this.ui.showSuccess("Editing presale codes");
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
sendScrapeMap(eventId) {
|
|
340
|
+
this.sendMessage({
|
|
341
|
+
event: "scrape-map",
|
|
342
|
+
data: {
|
|
343
|
+
eventId: eventId,
|
|
344
|
+
siteId: this.ui.currentCountry.siteId
|
|
345
|
+
}
|
|
346
|
+
});
|
|
347
|
+
this.ui.showSuccess("Scraping map");
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
sendCheckStock(eventId, presaleCode, eventDid, clOrigin) {
|
|
351
|
+
this.sendMessage({
|
|
352
|
+
event: "check-stock",
|
|
353
|
+
data: {
|
|
354
|
+
eventId: eventId,
|
|
355
|
+
eventDid: eventDid,
|
|
356
|
+
clOrigin: clOrigin,
|
|
357
|
+
presaleCode: presaleCode,
|
|
358
|
+
siteId: this.ui.currentCountry.siteId
|
|
359
|
+
}
|
|
360
|
+
});
|
|
361
|
+
this.ui.showSuccess("Checked stock");
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
sendSaveProfile(profile) {
|
|
365
|
+
this.sendMessage({
|
|
366
|
+
event: "profiles/save",
|
|
367
|
+
data: profile
|
|
368
|
+
});
|
|
369
|
+
this.ui.showSuccess("Saved Profile");
|
|
370
|
+
}
|
|
371
|
+
|
|
372
|
+
sendSaveAccount(account) {
|
|
373
|
+
this.sendMessage({
|
|
374
|
+
event: "accounts/save",
|
|
375
|
+
data: account
|
|
376
|
+
});
|
|
377
|
+
this.ui.showSuccess("Saved Account");
|
|
378
|
+
}
|
|
379
|
+
|
|
380
|
+
sendDeleteProfile(id) {
|
|
381
|
+
this.sendMessage({
|
|
382
|
+
event: "profiles/delete",
|
|
383
|
+
data: { _id: id }
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
sendCreateAccounts(config) {
|
|
388
|
+
this.sendMessage({
|
|
389
|
+
event: "accounts/create",
|
|
390
|
+
data: {
|
|
391
|
+
...config,
|
|
392
|
+
emails: config.emails
|
|
393
|
+
?.trim()
|
|
394
|
+
?.split("\n")
|
|
395
|
+
.map((e) => e.trim())
|
|
396
|
+
}
|
|
397
|
+
});
|
|
398
|
+
}
|
|
399
|
+
}
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
export const countries = {
|
|
2
|
+
TM: [
|
|
3
|
+
{
|
|
4
|
+
url: "https://www.ticketmaster.com",
|
|
5
|
+
id: "US",
|
|
6
|
+
siteId: "TM_US"
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
url: "https://www.ticketmaster.co.uk",
|
|
10
|
+
id: "United Kingdom",
|
|
11
|
+
siteId: "TM_UK"
|
|
12
|
+
},
|
|
13
|
+
{
|
|
14
|
+
url: "https://www.ticketmaster.com.au",
|
|
15
|
+
id: "Australia",
|
|
16
|
+
siteId: "TM_AU"
|
|
17
|
+
},
|
|
18
|
+
{
|
|
19
|
+
url: "https://www.ticketmaster.at",
|
|
20
|
+
id: "Austria",
|
|
21
|
+
siteId: "TM_AT"
|
|
22
|
+
},
|
|
23
|
+
{
|
|
24
|
+
url: "https://www.ticketmaster.be",
|
|
25
|
+
id: "Belgium",
|
|
26
|
+
siteId: "TM_BE"
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
url: "https://www.ticketmaster.cz",
|
|
30
|
+
id: "Czech Rep.",
|
|
31
|
+
siteId: "TM_CZ"
|
|
32
|
+
},
|
|
33
|
+
{
|
|
34
|
+
url: "https://www.ticketmaster.dk",
|
|
35
|
+
id: "Denmark",
|
|
36
|
+
siteId: "TM_DK"
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
url: "https://www.ticketmaster.ae",
|
|
40
|
+
id: "Emirates",
|
|
41
|
+
siteId: "TM_AE"
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
url: "https://www.ticketmaster.de",
|
|
45
|
+
id: "Germany",
|
|
46
|
+
siteId: "TM_DE"
|
|
47
|
+
},
|
|
48
|
+
{
|
|
49
|
+
url: "https://www.ticketmaster.nl",
|
|
50
|
+
id: "Netherlands",
|
|
51
|
+
siteId: "TM_NL"
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
url: "https://www.ticketmaster.co.nz",
|
|
55
|
+
id: "New Zealand",
|
|
56
|
+
siteId: "TM_NZ"
|
|
57
|
+
},
|
|
58
|
+
{
|
|
59
|
+
url: "https://www.ticketmaster.no",
|
|
60
|
+
id: "Norway",
|
|
61
|
+
siteId: "TM_NO"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
url: "https://www.ticketmaster.pl",
|
|
65
|
+
id: "Poland",
|
|
66
|
+
siteId: "TM_PL"
|
|
67
|
+
},
|
|
68
|
+
{
|
|
69
|
+
url: "https://www.ticketmaster.es",
|
|
70
|
+
id: "Spain",
|
|
71
|
+
siteId: "TM_ES"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
url: "https://www.ticketmaster.se",
|
|
75
|
+
id: "Sweden",
|
|
76
|
+
siteId: "TM_SE"
|
|
77
|
+
},
|
|
78
|
+
{
|
|
79
|
+
url: "https://www.ticketmaster.ch",
|
|
80
|
+
id: "Switzerland",
|
|
81
|
+
siteId: "TM_CH"
|
|
82
|
+
}
|
|
83
|
+
].sort((a, b) => a.siteId.localeCompare(b.siteId)),
|
|
84
|
+
AXS: [
|
|
85
|
+
{ url: "https://www.axs.com/", id: "US", siteId: "AXS_US" },
|
|
86
|
+
{ url: "https://www.axs.com/uk", id: "UK", siteId: "AXS_UK" }
|
|
87
|
+
]
|
|
88
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
const zeroPadding = (num, length) => String(num).padStart(length, "0");
|
|
2
|
+
|
|
3
|
+
const timestamp = () => {
|
|
4
|
+
const now = new Date();
|
|
5
|
+
const hours = zeroPadding(now.getHours(), 2);
|
|
6
|
+
const minutes = zeroPadding(now.getMinutes(), 2);
|
|
7
|
+
const seconds = zeroPadding(now.getSeconds(), 2);
|
|
8
|
+
const milli = zeroPadding(now.getMilliseconds(), 3);
|
|
9
|
+
|
|
10
|
+
return `${hours}:${minutes}:${seconds}.${milli}`;
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
const LOG_COLORS = {
|
|
14
|
+
error: "color: #ff4444; font-weight: bold", // Light red
|
|
15
|
+
success: "color: #00C851; font-weight: bold", // Green
|
|
16
|
+
info: "color: #33b5e5; font-weight: bold", // Light blue
|
|
17
|
+
debug: "color: #aa66cc; font-weight: bold", // Purple
|
|
18
|
+
yellow: "color: #ffbb33; font-weight: bold", // Yellow
|
|
19
|
+
reset: ""
|
|
20
|
+
};
|
|
21
|
+
class Logger {
|
|
22
|
+
constructor() {
|
|
23
|
+
this.ENABLED = true;
|
|
24
|
+
this.URGENT = false;
|
|
25
|
+
this.DEBUG = false;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
log(...args) {
|
|
29
|
+
if (!this.ENABLED) return;
|
|
30
|
+
|
|
31
|
+
let style = "";
|
|
32
|
+
if (args[args.length - 1] in LOG_COLORS) {
|
|
33
|
+
style = LOG_COLORS[args.pop()];
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
const timestamp = `[${this.getTimestamp()}]`;
|
|
37
|
+
|
|
38
|
+
if (this.defaultArgs) {
|
|
39
|
+
this.defaultArgs.forEach((arg) => {
|
|
40
|
+
const defaultArg = `[${arg}]`;
|
|
41
|
+
args.unshift(defaultArg);
|
|
42
|
+
});
|
|
43
|
+
}
|
|
44
|
+
|
|
45
|
+
args.unshift(timestamp);
|
|
46
|
+
|
|
47
|
+
// Format objects for console output
|
|
48
|
+
const formattedArgs = args.map((arg) => {
|
|
49
|
+
if (typeof arg === "object" && arg !== null) {
|
|
50
|
+
console.log(arg._value ? arg._value : arg);
|
|
51
|
+
return arg;
|
|
52
|
+
}
|
|
53
|
+
return arg;
|
|
54
|
+
});
|
|
55
|
+
|
|
56
|
+
// For styled console output in browser
|
|
57
|
+
if (style) {
|
|
58
|
+
console.log(`%c${formattedArgs.join(" ")}`, style);
|
|
59
|
+
} else {
|
|
60
|
+
console.log(...formattedArgs);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
getTimestamp() {
|
|
65
|
+
return timestamp();
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
Error(...args) {
|
|
69
|
+
const formattedArgs = args.map((arg) => {
|
|
70
|
+
if (arg instanceof Error) return arg.stack || arg.toString();
|
|
71
|
+
if (arg instanceof Object) return JSON.stringify(arg, null, 4);
|
|
72
|
+
return arg;
|
|
73
|
+
});
|
|
74
|
+
this.log(...formattedArgs, "error");
|
|
75
|
+
}
|
|
76
|
+
|
|
77
|
+
Success(...args) {
|
|
78
|
+
this.log(...args, "success");
|
|
79
|
+
}
|
|
80
|
+
|
|
81
|
+
Info(...args) {
|
|
82
|
+
if (!this.URGENT) this.log(...args, "info");
|
|
83
|
+
}
|
|
84
|
+
|
|
85
|
+
Debug(...args) {
|
|
86
|
+
if (!this.URGENT && this.DEBUG) this.log(...args, "debug");
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
Yellow(...args) {
|
|
90
|
+
if (!this.URGENT) this.log(...args, "yellow");
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
Disable() {
|
|
94
|
+
this.ENABLED = false;
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
// Export as an object instead of using module.exports
|
|
99
|
+
export const createLogger = (args) => {
|
|
100
|
+
const logger = new Logger();
|
|
101
|
+
logger.defaultArgs = typeof args === "string" ? [args] : Array.isArray(args) ? args : undefined;
|
|
102
|
+
return logger;
|
|
103
|
+
};
|
|
@@ -0,0 +1,88 @@
|
|
|
1
|
+
async function sendLogin(name, password) {
|
|
2
|
+
const options = {
|
|
3
|
+
method: "POST",
|
|
4
|
+
headers: {
|
|
5
|
+
"Content-Type": "application/json"
|
|
6
|
+
},
|
|
7
|
+
body: JSON.stringify({ name, password }),
|
|
8
|
+
credentials: "include"
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
const res = await fetch("/api/login", options);
|
|
12
|
+
return res.json();
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
async function sendLogout() {
|
|
16
|
+
const options = {
|
|
17
|
+
method: "POST",
|
|
18
|
+
headers: {
|
|
19
|
+
"Content-Type": "application/json"
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
|
|
23
|
+
const res = await fetch("/api/logout", options);
|
|
24
|
+
return res.json();
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
async function sendQuickConfig(content) {
|
|
28
|
+
const s = JSON.stringify(content);
|
|
29
|
+
|
|
30
|
+
await fetch("/api/quickconfig", {
|
|
31
|
+
method: "POST",
|
|
32
|
+
headers: { "Content-Type": "application/json" },
|
|
33
|
+
body: JSON.stringify({ content: btoa(s) })
|
|
34
|
+
});
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
async function getQuickConfig() {
|
|
38
|
+
const resp = await fetch("/api/quickconfig");
|
|
39
|
+
return resp.json();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
async function sendProxyList(value) {
|
|
43
|
+
const res = await fetch("/api/userconfig/set", {
|
|
44
|
+
method: "POST",
|
|
45
|
+
headers: { "content-type": "application/json" },
|
|
46
|
+
body: JSON.stringify({ field: "proxylist", value })
|
|
47
|
+
});
|
|
48
|
+
return res.json();
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
async function getProxyLists() {
|
|
52
|
+
const resp = await fetch("/api/userconfig/proxylists");
|
|
53
|
+
return resp.json();
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
async function getProxyFile(file) {
|
|
57
|
+
const res = await fetch("/api/proxies?file=" + file);
|
|
58
|
+
return res.text();
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
|
|
62
|
+
async function getBalances() {
|
|
63
|
+
const resp = await fetch("/api/userconfig/balances");
|
|
64
|
+
return resp.json();
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
async function sendSaveFilter(data) {
|
|
68
|
+
const resp = await fetch("/api/filter/save", {
|
|
69
|
+
method: "POST",
|
|
70
|
+
headers: {
|
|
71
|
+
"Content-Type": "application/json"
|
|
72
|
+
},
|
|
73
|
+
body: JSON.stringify(data)
|
|
74
|
+
});
|
|
75
|
+
return resp.text();
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
export {
|
|
79
|
+
sendLogin,
|
|
80
|
+
sendQuickConfig,
|
|
81
|
+
getQuickConfig,
|
|
82
|
+
sendProxyList,
|
|
83
|
+
getProxyLists,
|
|
84
|
+
getBalances,
|
|
85
|
+
sendLogout,
|
|
86
|
+
getProxyFile,
|
|
87
|
+
sendSaveFilter
|
|
88
|
+
};
|