blockmine 1.2.0 → 1.2.13

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 (50) hide show
  1. package/backend/cli.js +22 -15
  2. package/backend/nodemon.json +1 -1
  3. package/backend/package-lock.json +2539 -2539
  4. package/backend/package.json +20 -33
  5. package/backend/prisma/generated/client/default.d.ts +1 -0
  6. package/backend/prisma/generated/client/default.js +1 -0
  7. package/backend/prisma/generated/client/edge.d.ts +1 -0
  8. package/backend/prisma/generated/client/edge.js +280 -0
  9. package/backend/prisma/generated/client/index-browser.js +272 -0
  10. package/backend/prisma/generated/client/index.d.ts +16892 -0
  11. package/backend/prisma/generated/client/index.js +301 -0
  12. package/backend/prisma/generated/client/package.json +97 -0
  13. package/backend/prisma/generated/client/query_engine-windows.dll.node +0 -0
  14. package/backend/prisma/generated/client/runtime/edge-esm.js +31 -0
  15. package/backend/prisma/generated/client/runtime/edge.js +31 -0
  16. package/backend/prisma/generated/client/runtime/index-browser.d.ts +365 -0
  17. package/backend/prisma/generated/client/runtime/index-browser.js +13 -0
  18. package/backend/prisma/generated/client/runtime/library.d.ts +3403 -0
  19. package/backend/prisma/generated/client/runtime/library.js +143 -0
  20. package/backend/prisma/generated/client/runtime/react-native.js +80 -0
  21. package/backend/prisma/generated/client/runtime/wasm.js +32 -0
  22. package/backend/prisma/generated/client/schema.prisma +148 -0
  23. package/backend/prisma/generated/client/wasm.d.ts +1 -0
  24. package/backend/prisma/generated/client/wasm.js +272 -0
  25. package/backend/prisma/migrations/20250615232848_add_scheduled_tasks/migration.sql +13 -0
  26. package/backend/prisma/schema.prisma +151 -137
  27. package/backend/prisma/seed.js +18 -39
  28. package/backend/src/api/routes/bots.js +1 -1
  29. package/backend/src/api/routes/permissions.js +1 -1
  30. package/backend/src/api/routes/servers.js +1 -1
  31. package/backend/src/api/routes/settings.js +1 -1
  32. package/backend/src/api/routes/tasks.js +95 -0
  33. package/backend/src/core/BotManager.js +9 -1
  34. package/backend/src/core/PermissionManager.js +1 -1
  35. package/backend/src/core/PluginManager.js +65 -19
  36. package/backend/src/core/PluginService.js +1 -1
  37. package/backend/src/core/TaskScheduler.js +117 -0
  38. package/backend/src/core/UserService.js +1 -1
  39. package/backend/src/real-time/socketHandler.js +30 -30
  40. package/backend/src/server.js +22 -20
  41. package/frontend/dist/assets/index-4S5VJ11r.js +8179 -0
  42. package/frontend/dist/assets/index-B5_cke-P.css +1 -0
  43. package/frontend/dist/favicon.svg +2 -2
  44. package/frontend/dist/index.html +20 -20
  45. package/frontend/dist/logo.svg +178 -178
  46. package/frontend/dist/site.webmanifest +20 -20
  47. package/frontend/package.json +66 -65
  48. package/package.json +42 -38
  49. package/frontend/dist/assets/index-8hxjI7oG.css +0 -1
  50. package/frontend/dist/assets/index-Brxc-96r.js +0 -8179
@@ -0,0 +1,272 @@
1
+
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+
4
+ const {
5
+ Decimal,
6
+ objectEnumValues,
7
+ makeStrictEnum,
8
+ Public,
9
+ getRuntime,
10
+ skip
11
+ } = require('./runtime/index-browser.js')
12
+
13
+
14
+ const Prisma = {}
15
+
16
+ exports.Prisma = Prisma
17
+ exports.$Enums = {}
18
+
19
+ /**
20
+ * Prisma Client JS version: 5.22.0
21
+ * Query Engine version: 605197351a3c8bdd595af2d2a9bc3025bca48ea2
22
+ */
23
+ Prisma.prismaVersion = {
24
+ client: "5.22.0",
25
+ engine: "605197351a3c8bdd595af2d2a9bc3025bca48ea2"
26
+ }
27
+
28
+ Prisma.PrismaClientKnownRequestError = () => {
29
+ const runtimeName = getRuntime().prettyName;
30
+ throw new Error(`PrismaClientKnownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
31
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
32
+ )};
33
+ Prisma.PrismaClientUnknownRequestError = () => {
34
+ const runtimeName = getRuntime().prettyName;
35
+ throw new Error(`PrismaClientUnknownRequestError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
36
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
37
+ )}
38
+ Prisma.PrismaClientRustPanicError = () => {
39
+ const runtimeName = getRuntime().prettyName;
40
+ throw new Error(`PrismaClientRustPanicError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
41
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
42
+ )}
43
+ Prisma.PrismaClientInitializationError = () => {
44
+ const runtimeName = getRuntime().prettyName;
45
+ throw new Error(`PrismaClientInitializationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
46
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
47
+ )}
48
+ Prisma.PrismaClientValidationError = () => {
49
+ const runtimeName = getRuntime().prettyName;
50
+ throw new Error(`PrismaClientValidationError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
51
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
52
+ )}
53
+ Prisma.NotFoundError = () => {
54
+ const runtimeName = getRuntime().prettyName;
55
+ throw new Error(`NotFoundError is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
56
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
57
+ )}
58
+ Prisma.Decimal = Decimal
59
+
60
+ /**
61
+ * Re-export of sql-template-tag
62
+ */
63
+ Prisma.sql = () => {
64
+ const runtimeName = getRuntime().prettyName;
65
+ throw new Error(`sqltag is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
66
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
67
+ )}
68
+ Prisma.empty = () => {
69
+ const runtimeName = getRuntime().prettyName;
70
+ throw new Error(`empty is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
71
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
72
+ )}
73
+ Prisma.join = () => {
74
+ const runtimeName = getRuntime().prettyName;
75
+ throw new Error(`join is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
76
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
77
+ )}
78
+ Prisma.raw = () => {
79
+ const runtimeName = getRuntime().prettyName;
80
+ throw new Error(`raw is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
81
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
82
+ )}
83
+ Prisma.validator = Public.validator
84
+
85
+ /**
86
+ * Extensions
87
+ */
88
+ Prisma.getExtensionContext = () => {
89
+ const runtimeName = getRuntime().prettyName;
90
+ throw new Error(`Extensions.getExtensionContext is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
91
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
92
+ )}
93
+ Prisma.defineExtension = () => {
94
+ const runtimeName = getRuntime().prettyName;
95
+ throw new Error(`Extensions.defineExtension is unable to run in this browser environment, or has been bundled for the browser (running in ${runtimeName}).
96
+ In case this error is unexpected for you, please report it in https://pris.ly/prisma-prisma-bug-report`,
97
+ )}
98
+
99
+ /**
100
+ * Shorthand utilities for JSON filtering
101
+ */
102
+ Prisma.DbNull = objectEnumValues.instances.DbNull
103
+ Prisma.JsonNull = objectEnumValues.instances.JsonNull
104
+ Prisma.AnyNull = objectEnumValues.instances.AnyNull
105
+
106
+ Prisma.NullTypes = {
107
+ DbNull: objectEnumValues.classes.DbNull,
108
+ JsonNull: objectEnumValues.classes.JsonNull,
109
+ AnyNull: objectEnumValues.classes.AnyNull
110
+ }
111
+
112
+
113
+
114
+ /**
115
+ * Enums
116
+ */
117
+
118
+ exports.Prisma.TransactionIsolationLevel = makeStrictEnum({
119
+ Serializable: 'Serializable'
120
+ });
121
+
122
+ exports.Prisma.ServerScalarFieldEnum = {
123
+ id: 'id',
124
+ name: 'name',
125
+ host: 'host',
126
+ port: 'port',
127
+ version: 'version'
128
+ };
129
+
130
+ exports.Prisma.BotScalarFieldEnum = {
131
+ id: 'id',
132
+ username: 'username',
133
+ password: 'password',
134
+ prefix: 'prefix',
135
+ note: 'note',
136
+ owners: 'owners',
137
+ serverId: 'serverId',
138
+ proxyHost: 'proxyHost',
139
+ proxyPort: 'proxyPort',
140
+ proxyUsername: 'proxyUsername',
141
+ proxyPassword: 'proxyPassword',
142
+ createdAt: 'createdAt',
143
+ updatedAt: 'updatedAt'
144
+ };
145
+
146
+ exports.Prisma.InstalledPluginScalarFieldEnum = {
147
+ id: 'id',
148
+ botId: 'botId',
149
+ name: 'name',
150
+ version: 'version',
151
+ description: 'description',
152
+ sourceType: 'sourceType',
153
+ sourceUri: 'sourceUri',
154
+ path: 'path',
155
+ isEnabled: 'isEnabled',
156
+ manifest: 'manifest',
157
+ settings: 'settings',
158
+ createdAt: 'createdAt'
159
+ };
160
+
161
+ exports.Prisma.CommandScalarFieldEnum = {
162
+ id: 'id',
163
+ botId: 'botId',
164
+ name: 'name',
165
+ isEnabled: 'isEnabled',
166
+ cooldown: 'cooldown',
167
+ aliases: 'aliases',
168
+ description: 'description',
169
+ owner: 'owner',
170
+ permissionId: 'permissionId',
171
+ allowedChatTypes: 'allowedChatTypes'
172
+ };
173
+
174
+ exports.Prisma.UserScalarFieldEnum = {
175
+ id: 'id',
176
+ username: 'username',
177
+ isBlacklisted: 'isBlacklisted',
178
+ botId: 'botId'
179
+ };
180
+
181
+ exports.Prisma.GroupScalarFieldEnum = {
182
+ id: 'id',
183
+ name: 'name',
184
+ owner: 'owner',
185
+ botId: 'botId'
186
+ };
187
+
188
+ exports.Prisma.PermissionScalarFieldEnum = {
189
+ id: 'id',
190
+ name: 'name',
191
+ description: 'description',
192
+ owner: 'owner',
193
+ botId: 'botId'
194
+ };
195
+
196
+ exports.Prisma.UserGroupScalarFieldEnum = {
197
+ userId: 'userId',
198
+ groupId: 'groupId'
199
+ };
200
+
201
+ exports.Prisma.GroupPermissionScalarFieldEnum = {
202
+ groupId: 'groupId',
203
+ permissionId: 'permissionId'
204
+ };
205
+
206
+ exports.Prisma.ScheduledTaskScalarFieldEnum = {
207
+ id: 'id',
208
+ name: 'name',
209
+ cronPattern: 'cronPattern',
210
+ action: 'action',
211
+ targetBotIds: 'targetBotIds',
212
+ payload: 'payload',
213
+ isEnabled: 'isEnabled',
214
+ lastRun: 'lastRun',
215
+ createdAt: 'createdAt',
216
+ updatedAt: 'updatedAt'
217
+ };
218
+
219
+ exports.Prisma.SortOrder = {
220
+ asc: 'asc',
221
+ desc: 'desc'
222
+ };
223
+
224
+ exports.Prisma.NullsOrder = {
225
+ first: 'first',
226
+ last: 'last'
227
+ };
228
+
229
+
230
+ exports.Prisma.ModelName = {
231
+ Server: 'Server',
232
+ Bot: 'Bot',
233
+ InstalledPlugin: 'InstalledPlugin',
234
+ Command: 'Command',
235
+ User: 'User',
236
+ Group: 'Group',
237
+ Permission: 'Permission',
238
+ UserGroup: 'UserGroup',
239
+ GroupPermission: 'GroupPermission',
240
+ ScheduledTask: 'ScheduledTask'
241
+ };
242
+
243
+ /**
244
+ * This is a stub Prisma Client that will error at runtime if called.
245
+ */
246
+ class PrismaClient {
247
+ constructor() {
248
+ return new Proxy(this, {
249
+ get(target, prop) {
250
+ let message
251
+ const runtime = getRuntime()
252
+ if (runtime.isEdge) {
253
+ message = `PrismaClient is not configured to run in ${runtime.prettyName}. In order to run Prisma Client on edge runtime, either:
254
+ - Use Prisma Accelerate: https://pris.ly/d/accelerate
255
+ - Use Driver Adapters: https://pris.ly/d/driver-adapters
256
+ `;
257
+ } else {
258
+ message = 'PrismaClient is unable to run in this browser environment, or has been bundled for the browser (running in `' + runtime.prettyName + '`).'
259
+ }
260
+
261
+ message += `
262
+ If this is unexpected, please open an issue: https://pris.ly/prisma-prisma-bug-report`
263
+
264
+ throw new Error(message)
265
+ }
266
+ })
267
+ }
268
+ }
269
+
270
+ exports.PrismaClient = PrismaClient
271
+
272
+ Object.assign(exports, Prisma)
@@ -0,0 +1,13 @@
1
+ -- CreateTable
2
+ CREATE TABLE "ScheduledTask" (
3
+ "id" INTEGER NOT NULL PRIMARY KEY AUTOINCREMENT,
4
+ "name" TEXT NOT NULL,
5
+ "cronPattern" TEXT NOT NULL,
6
+ "action" TEXT NOT NULL,
7
+ "targetBotIds" TEXT NOT NULL,
8
+ "payload" TEXT DEFAULT '{}',
9
+ "isEnabled" BOOLEAN NOT NULL DEFAULT true,
10
+ "lastRun" DATETIME,
11
+ "createdAt" DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP,
12
+ "updatedAt" DATETIME NOT NULL
13
+ );
@@ -1,138 +1,152 @@
1
- // backend/prisma/schema.prisma
2
-
3
- generator client {
4
- provider = "prisma-client-js"
5
- }
6
-
7
- datasource db {
8
- provider = "sqlite"
9
- url = env("DATABASE_URL")
10
- }
11
-
12
- model Server {
13
- id Int @id @default(autoincrement())
14
- name String @unique
15
- host String
16
- port Int @default(25565)
17
- version String
18
- bots Bot[]
19
- }
20
-
21
- model Bot {
22
- id Int @id @default(autoincrement())
23
- username String @unique
24
- password String?
25
- prefix String? @default("@")
26
- note String?
27
- owners String? @default("")
28
-
29
- server Server @relation(fields: [serverId], references: [id])
30
- serverId Int
31
-
32
- proxyHost String?
33
- proxyPort Int?
34
- proxyUsername String?
35
- proxyPassword String?
36
-
37
- installedPlugins InstalledPlugin[]
38
- users User[]
39
- groups Group[]
40
- permissions Permission[]
41
- commands Command[]
42
-
43
- createdAt DateTime @default(now())
44
- updatedAt DateTime @updatedAt
45
- }
46
-
47
-
48
- model InstalledPlugin {
49
- id Int @id @default(autoincrement())
50
- botId Int
51
- bot Bot @relation(fields: [botId], references: [id], onDelete: Cascade)
52
- name String
53
- version String
54
- description String?
55
- sourceType String
56
- sourceUri String?
57
- path String
58
- isEnabled Boolean @default(true)
59
-
60
- manifest String?
61
- settings String? @default("{}")
62
-
63
- createdAt DateTime @default(now())
64
-
65
- @@unique([botId, name])
66
- }
67
-
68
- model Command {
69
- id Int @id @default(autoincrement())
70
- botId Int
71
- bot Bot @relation(fields: [botId], references: [id], onDelete: Cascade)
72
- name String
73
- isEnabled Boolean @default(true)
74
- cooldown Int @default(0)
75
- aliases String @default("[]") // Храним как джсон строку
76
- description String?
77
- owner String?
78
- permissionId Int?
79
- permission Permission? @relation(fields: [permissionId], references: [id], onDelete: SetNull)
80
- allowedChatTypes String @default("[\"chat\", \"private\"]")
81
-
82
- @@unique([botId, name])
83
- }
84
-
85
- model User {
86
- id Int @id @default(autoincrement())
87
- username String
88
- isBlacklisted Boolean @default(false)
89
- botId Int
90
- bot Bot @relation(fields: [botId], references: [id], onDelete: Cascade)
91
- groups UserGroup[]
92
-
93
- @@unique([botId, username])
94
- }
95
-
96
- model Group {
97
- id Int @id @default(autoincrement())
98
- name String
99
- owner String @default("system")
100
- botId Int
101
- bot Bot @relation(fields: [botId], references: [id], onDelete: Cascade)
102
- permissions GroupPermission[]
103
- users UserGroup[]
104
-
105
- @@unique([botId, name])
106
- }
107
-
108
- model Permission {
109
- id Int @id @default(autoincrement())
110
- name String
111
- description String?
112
- owner String @default("system")
113
- botId Int
114
- bot Bot @relation(fields: [botId], references: [id], onDelete: Cascade)
115
- groups GroupPermission[]
116
- commands Command[]
117
-
118
- @@unique([botId, name])
119
- }
120
-
121
-
122
- model UserGroup {
123
- user User @relation(fields: [userId], references: [id], onDelete: Cascade)
124
- userId Int
125
- group Group @relation(fields: [groupId], references: [id], onDelete: Cascade)
126
- groupId Int
127
-
128
- @@id([userId, groupId])
129
- }
130
-
131
- model GroupPermission {
132
- group Group @relation(fields: [groupId], references: [id], onDelete: Cascade)
133
- groupId Int
134
- permission Permission @relation(fields: [permissionId], references: [id], onDelete: Cascade)
135
- permissionId Int
136
-
137
- @@id([groupId, permissionId])
1
+ generator client {
2
+ provider = "prisma-client-js"
3
+ output = "./generated/client"
4
+ }
5
+
6
+ datasource db {
7
+ provider = "sqlite"
8
+ url = env("DATABASE_URL")
9
+ }
10
+
11
+ model Server {
12
+ id Int @id @default(autoincrement())
13
+ name String @unique
14
+ host String
15
+ port Int @default(25565)
16
+ version String
17
+ bots Bot[]
18
+ }
19
+
20
+ model Bot {
21
+ id Int @id @default(autoincrement())
22
+ username String @unique
23
+ password String?
24
+ prefix String? @default("@")
25
+ note String?
26
+ owners String? @default("")
27
+
28
+ server Server @relation(fields: [serverId], references: [id])
29
+ serverId Int
30
+
31
+ proxyHost String?
32
+ proxyPort Int?
33
+ proxyUsername String?
34
+ proxyPassword String?
35
+
36
+ installedPlugins InstalledPlugin[]
37
+ users User[]
38
+ groups Group[]
39
+ permissions Permission[]
40
+ commands Command[]
41
+
42
+ createdAt DateTime @default(now())
43
+ updatedAt DateTime @updatedAt
44
+ }
45
+
46
+
47
+ model InstalledPlugin {
48
+ id Int @id @default(autoincrement())
49
+ botId Int
50
+ bot Bot @relation(fields: [botId], references: [id], onDelete: Cascade)
51
+ name String
52
+ version String
53
+ description String?
54
+ sourceType String
55
+ sourceUri String?
56
+ path String
57
+ isEnabled Boolean @default(true)
58
+
59
+ manifest String?
60
+ settings String? @default("{}")
61
+
62
+ createdAt DateTime @default(now())
63
+
64
+ @@unique([botId, name])
65
+ }
66
+
67
+ model Command {
68
+ id Int @id @default(autoincrement())
69
+ botId Int
70
+ bot Bot @relation(fields: [botId], references: [id], onDelete: Cascade)
71
+ name String
72
+ isEnabled Boolean @default(true)
73
+ cooldown Int @default(0)
74
+ aliases String @default("[]") // Храним как джсон строку
75
+ description String?
76
+ owner String?
77
+ permissionId Int?
78
+ permission Permission? @relation(fields: [permissionId], references: [id], onDelete: SetNull)
79
+ allowedChatTypes String @default("[\"chat\", \"private\"]")
80
+
81
+ @@unique([botId, name])
82
+ }
83
+
84
+ model User {
85
+ id Int @id @default(autoincrement())
86
+ username String
87
+ isBlacklisted Boolean @default(false)
88
+ botId Int
89
+ bot Bot @relation(fields: [botId], references: [id], onDelete: Cascade)
90
+ groups UserGroup[]
91
+
92
+ @@unique([botId, username])
93
+ }
94
+
95
+ model Group {
96
+ id Int @id @default(autoincrement())
97
+ name String
98
+ owner String @default("system")
99
+ botId Int
100
+ bot Bot @relation(fields: [botId], references: [id], onDelete: Cascade)
101
+ permissions GroupPermission[]
102
+ users UserGroup[]
103
+
104
+ @@unique([botId, name])
105
+ }
106
+
107
+ model Permission {
108
+ id Int @id @default(autoincrement())
109
+ name String
110
+ description String?
111
+ owner String @default("system")
112
+ botId Int
113
+ bot Bot @relation(fields: [botId], references: [id], onDelete: Cascade)
114
+ groups GroupPermission[]
115
+ commands Command[]
116
+
117
+ @@unique([botId, name])
118
+ }
119
+
120
+
121
+ model UserGroup {
122
+ user User @relation(fields: [userId], references: [id], onDelete: Cascade)
123
+ userId Int
124
+ group Group @relation(fields: [groupId], references: [id], onDelete: Cascade)
125
+ groupId Int
126
+
127
+ @@id([userId, groupId])
128
+ }
129
+
130
+ model GroupPermission {
131
+ group Group @relation(fields: [groupId], references: [id], onDelete: Cascade)
132
+ groupId Int
133
+ permission Permission @relation(fields: [permissionId], references: [id], onDelete: Cascade)
134
+ permissionId Int
135
+
136
+ @@id([groupId, permissionId])
137
+ }
138
+
139
+
140
+
141
+ model ScheduledTask {
142
+ id Int @id @default(autoincrement())
143
+ name String
144
+ cronPattern String
145
+ action String
146
+ targetBotIds String // джсон массив ID ботов или "ALL"
147
+ payload String? @default("{}") // джсон для доп данных, например, команды
148
+ isEnabled Boolean @default(true)
149
+ lastRun DateTime?
150
+ createdAt DateTime @default(now())
151
+ updatedAt DateTime @updatedAt
138
152
  }
@@ -1,37 +1,12 @@
1
- const { PrismaClient } = require('@prisma/client');
1
+ const { PrismaClient } = require('../prisma/generated/client');
2
2
  const prisma = new PrismaClient();
3
3
 
4
4
  const initialServers = [
5
- {
6
- name: 'Local Test Server',
7
- host: '127.0.0.1',
8
- port: 25565,
9
- version: '1.20.4'
10
- },
11
- {
12
- name: 'MineBlaze',
13
- host: 'mc.mineblaze.net',
14
- port: 25565,
15
- version: '1.20.1'
16
- },
17
- {
18
- name: 'MasedWorld',
19
- host: 'mc.masedworld.net',
20
- port: 25565,
21
- version: '1.20.1'
22
- },
23
- {
24
- name: 'DexLand',
25
- host: 'mc.dexland.org',
26
- port: 25565,
27
- version: '1.20.1'
28
- },
29
- {
30
- name: 'CheatMine',
31
- host: 'mc.cheatmine.net',
32
- port: 25565,
33
- version: '1.20.1'
34
- }
5
+ { name: 'Local Test Server', host: '127.0.0.1', port: 25565, version: '1.20.4' },
6
+ { name: 'MineBlaze', host: 'mc.mineblaze.net', port: 25565, version: '1.20.1' },
7
+ { name: 'MasedWorld', host: 'mc.masedworld.net', port: 25565, version: '1.20.1' },
8
+ { name: 'DexLand', host: 'mc.dexland.org', port: 25565, version: '1.20.1' },
9
+ { name: 'CheatMine', host: 'mc.cheatmine.net', port: 25565, version: '1.20.1' }
35
10
  ];
36
11
 
37
12
  async function main() {
@@ -50,11 +25,15 @@ async function main() {
50
25
  console.log(`${initialServers.length} серверов были успешно созданы или уже существовали.`);
51
26
  }
52
27
 
53
- main()
54
- .catch((e) => {
55
- console.error('Error during seeding:', e);
56
- process.exit(1);
57
- })
58
- .finally(async () => {
59
- await prisma.$disconnect();
60
- });
28
+ if (require.main === module) {
29
+ main()
30
+ .catch((e) => {
31
+ console.error('Error during seeding:', e);
32
+ process.exit(1);
33
+ })
34
+ .finally(async () => {
35
+ await prisma.$disconnect();
36
+ });
37
+ }
38
+
39
+ module.exports = { main };
@@ -1,6 +1,6 @@
1
1
  const express = require('express');
2
2
  const router = express.Router();
3
- const { PrismaClient } = require('@prisma/client');
3
+ const { PrismaClient } = require('../../../prisma/generated/client');
4
4
  const path = require('path');
5
5
  const fs = require('fs/promises');
6
6
  const BotManager = require('../../core/BotManager');
@@ -1,6 +1,6 @@
1
1
  const express = require('express');
2
2
  const router = express.Router();
3
- const { PrismaClient } = require('@prisma/client');
3
+ const { PrismaClient } = require('../../../prisma/generated/client');
4
4
  const prisma = new PrismaClient();
5
5
 
6
6
 
@@ -1,6 +1,6 @@
1
1
  const express = require('express');
2
2
  const router = express.Router();
3
- const { PrismaClient } = require('@prisma/client');
3
+ const { PrismaClient } = require('../../../prisma/generated/client');
4
4
  const prisma = new PrismaClient();
5
5
 
6
6
  router.get('/', async (req, res) => {
@@ -1,6 +1,6 @@
1
1
  const express = require('express');
2
2
  const router = express.Router();
3
- const { PrismaClient } = require('@prisma/client');
3
+ const { PrismaClient } = require('../prisma/generated/client');
4
4
  const PluginService = require('../../core/PluginService');
5
5
 
6
6
  const prisma = new PrismaClient();