blockmine 1.2.13 → 1.3.1

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 (36) hide show
  1. package/backend/cli.js +3 -8
  2. package/backend/package.json +18 -2
  3. package/backend/prisma/schema.prisma +0 -1
  4. package/backend/prisma/seed.js +39 -18
  5. package/backend/src/api/routes/bots.js +1 -1
  6. package/backend/src/api/routes/permissions.js +1 -1
  7. package/backend/src/api/routes/servers.js +1 -1
  8. package/backend/src/api/routes/settings.js +1 -1
  9. package/backend/src/api/routes/tasks.js +1 -1
  10. package/backend/src/core/BotManager.js +1 -1
  11. package/backend/src/core/PermissionManager.js +1 -1
  12. package/backend/src/core/PluginManager.js +2 -2
  13. package/backend/src/core/PluginService.js +1 -1
  14. package/backend/src/core/TaskScheduler.js +1 -1
  15. package/backend/src/core/UserService.js +1 -1
  16. package/package.json +14 -18
  17. package/backend/prisma/generated/client/default.d.ts +0 -1
  18. package/backend/prisma/generated/client/default.js +0 -1
  19. package/backend/prisma/generated/client/edge.d.ts +0 -1
  20. package/backend/prisma/generated/client/edge.js +0 -280
  21. package/backend/prisma/generated/client/index-browser.js +0 -272
  22. package/backend/prisma/generated/client/index.d.ts +0 -16892
  23. package/backend/prisma/generated/client/index.js +0 -301
  24. package/backend/prisma/generated/client/package.json +0 -97
  25. package/backend/prisma/generated/client/query_engine-windows.dll.node +0 -0
  26. package/backend/prisma/generated/client/runtime/edge-esm.js +0 -31
  27. package/backend/prisma/generated/client/runtime/edge.js +0 -31
  28. package/backend/prisma/generated/client/runtime/index-browser.d.ts +0 -365
  29. package/backend/prisma/generated/client/runtime/index-browser.js +0 -13
  30. package/backend/prisma/generated/client/runtime/library.d.ts +0 -3403
  31. package/backend/prisma/generated/client/runtime/library.js +0 -143
  32. package/backend/prisma/generated/client/runtime/react-native.js +0 -80
  33. package/backend/prisma/generated/client/runtime/wasm.js +0 -32
  34. package/backend/prisma/generated/client/schema.prisma +0 -148
  35. package/backend/prisma/generated/client/wasm.d.ts +0 -1
  36. package/backend/prisma/generated/client/wasm.js +0 -272
package/backend/cli.js CHANGED
@@ -11,8 +11,6 @@ if (!fs.existsSync(DATA_DIR)) {
11
11
  }
12
12
  process.env.DATABASE_URL = `file:${path.join(DATA_DIR, 'blockmine.db')}`;
13
13
 
14
- const schemaPath = path.resolve(__dirname, 'prisma', 'schema.prisma');
15
-
16
14
  function runCommand(command) {
17
15
  try {
18
16
  console.log(`> ${command}`);
@@ -26,19 +24,16 @@ function runCommand(command) {
26
24
  async function main() {
27
25
  console.log('Запуск панели управления BlockMine...');
28
26
 
29
- const migrateCommand = `npx prisma migrate deploy --schema="${schemaPath}"`;
30
- const seedCommand = `npx prisma db seed --schema="${schemaPath}"`;
31
-
32
27
  const dbPath = path.join(DATA_DIR, 'blockmine.db');
33
28
  if (!fs.existsSync(dbPath)) {
34
29
  console.log('База данных не найдена. Создаем и применяем все миграции...');
35
- runCommand(migrateCommand);
30
+ runCommand(`npx prisma migrate deploy`);
36
31
  console.log('Заполнение базы данных начальными данными (серверами)...');
37
- runCommand(seedCommand);
32
+ runCommand(`npx prisma db seed`);
38
33
  console.log('Первоначальная настройка базы данных завершена.');
39
34
  } else {
40
35
  console.log('Проверка и применение обновлений базы данных...');
41
- runCommand(migrateCommand);
36
+ runCommand(`npx prisma migrate deploy`);
42
37
  console.log('База данных в актуальном состоянии.');
43
38
  }
44
39
 
@@ -14,8 +14,24 @@
14
14
  "keywords": [],
15
15
  "author": "",
16
16
  "license": "ISC",
17
- "dependencies": {},
17
+ "dependencies": {
18
+ "@prisma/client": "^5.14.0",
19
+ "adm-zip": "^0.5.16",
20
+ "archiver": "^7.0.1",
21
+ "cron-parser": "^5.3.0",
22
+ "express": "^4.19.2",
23
+ "fs-extra": "^11.3.0",
24
+ "mineflayer": "^4.20.1",
25
+ "multer": "^2.0.1",
26
+ "node-cron": "^4.1.0",
27
+ "pidusage": "^3.0.2",
28
+ "prisma": "^5.14.0",
29
+ "semver": "^7.6.2",
30
+ "socket.io": "^4.7.5",
31
+ "socks": "^2.8.5"
32
+ },
18
33
  "devDependencies": {
19
- "nodemon": "^3.1.2"
34
+ "nodemon": "^3.1.2",
35
+ "prisma": "^5.14.0"
20
36
  }
21
37
  }
@@ -1,6 +1,5 @@
1
1
  generator client {
2
2
  provider = "prisma-client-js"
3
- output = "./generated/client"
4
3
  }
5
4
 
6
5
  datasource db {
@@ -1,12 +1,37 @@
1
- const { PrismaClient } = require('../prisma/generated/client');
1
+ const { PrismaClient } = require('@prisma/client');
2
2
  const prisma = new PrismaClient();
3
3
 
4
4
  const initialServers = [
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' }
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
+ }
10
35
  ];
11
36
 
12
37
  async function main() {
@@ -25,15 +50,11 @@ async function main() {
25
50
  console.log(`${initialServers.length} серверов были успешно созданы или уже существовали.`);
26
51
  }
27
52
 
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 };
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
+ });
@@ -1,6 +1,6 @@
1
1
  const express = require('express');
2
2
  const router = express.Router();
3
- const { PrismaClient } = require('../../../prisma/generated/client');
3
+ const { PrismaClient } = require('@prisma/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/generated/client');
3
+ const { PrismaClient } = require('@prisma/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/generated/client');
3
+ const { PrismaClient } = require('@prisma/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/generated/client');
3
+ const { PrismaClient } = require('@prisma/client');
4
4
  const PluginService = require('../../core/PluginService');
5
5
 
6
6
  const prisma = new PrismaClient();
@@ -1,6 +1,6 @@
1
1
  const express = require('express');
2
2
  const router = express.Router();
3
- const { PrismaClient } = require('../../../prisma/generated/client');
3
+ const { PrismaClient } = require('@prisma/client');
4
4
  const TaskScheduler = require('../../core/TaskScheduler');
5
5
 
6
6
  const { CronExpressionParser } = require('cron-parser');
@@ -2,7 +2,7 @@
2
2
  const { fork } = require('child_process');
3
3
  const path = require('path');
4
4
  const { getIO } = require('../real-time/socketHandler');
5
- const { PrismaClient } = require('../../prisma/generated/client');
5
+ const { PrismaClient } = require('@prisma/client');
6
6
  const pidusage = require('pidusage');
7
7
  const DependencyService = require('./DependencyService');
8
8
 
@@ -1,4 +1,4 @@
1
- const { PrismaClient } = require('../../prisma/generated/client');
1
+ const { PrismaClient } = require('@prisma/client');
2
2
  const prisma = new PrismaClient();
3
3
 
4
4
  class PermissionManager {
@@ -1,7 +1,7 @@
1
1
  const path = require('path');
2
2
  const fse = require('fs-extra');
3
3
  const os = require('os');
4
- const { PrismaClient } = require('../../prisma/generated/client');
4
+ const { PrismaClient } = require('@prisma/client');
5
5
  const AdmZip = require('adm-zip');
6
6
  const semver = require('semver');
7
7
 
@@ -207,7 +207,7 @@ class PluginManager {
207
207
  console.error(`Не удалось удалить папку плагина ${plugin.path}:`, fileError);
208
208
  }
209
209
  }
210
- }
210
+ }
211
211
 
212
212
  async checkForUpdates(botId, catalog) {
213
213
  const githubPlugins = await prisma.installedPlugin.findMany({
@@ -1,7 +1,7 @@
1
1
 
2
2
  const fs = require('fs/promises');
3
3
  const path = require('path');
4
- const { PrismaClient } = require('../prisma/generated/client');
4
+ const { PrismaClient } = require('@prisma/client');
5
5
  const prisma = new PrismaClient();
6
6
 
7
7
  class PluginService {
@@ -1,5 +1,5 @@
1
1
  const cron = require('node-cron');
2
- const { PrismaClient } = require('../../prisma/generated/client');
2
+ const { PrismaClient } = require('@prisma/client');
3
3
  const BotManager = require('./BotManager');
4
4
 
5
5
  const prisma = new PrismaClient();
@@ -1,4 +1,4 @@
1
- const { PrismaClient } = require('../../prisma/generated/client');
1
+ const { PrismaClient } = require('@prisma/client');
2
2
  const prisma = new PrismaClient();
3
3
 
4
4
  class User {
package/package.json CHANGED
@@ -1,41 +1,37 @@
1
+
1
2
  {
2
3
  "name": "blockmine",
3
- "version": "1.2.13",
4
+ "version": "1.3.01",
4
5
  "description": "Мощная панель управления ботами для Майнкрафта.",
5
6
  "author": "merka",
6
7
  "license": "MIT",
7
8
  "repository": {
8
9
  "type": "git",
9
- "url": "git+https://github.com/blockmineJS/blockmine.git"
10
+ "url": "https://github.com/blockmineJS/blockmine.git"
10
11
  },
11
12
  "bin": {
12
13
  "blockmine": "backend/cli.js"
13
14
  },
15
+ "keywords": [
16
+ "minecraft",
17
+ "bot",
18
+ "mineflayer",
19
+ "dashboard",
20
+ "panel",
21
+ "automation"
22
+ ],
14
23
  "workspaces": [
15
24
  "backend",
16
25
  "frontend"
17
26
  ],
18
27
  "scripts": {
19
28
  "dev": "concurrently \"npm run dev --workspace=backend\" \"npm run dev --workspace=frontend\"",
20
- "postinstall": "npm install --workspaces && npx prisma generate --schema=./backend/prisma/schema.prisma",
29
+ "postinstall": "npm install --workspaces --ignore-scripts && prisma generate --schema=./backend/prisma/schema.prisma",
21
30
  "build": "npm run build --workspace=frontend",
22
- "prepublishOnly": "npm run build && npx prisma generate --schema=./backend/prisma/schema.prisma"
31
+ "prepublishOnly": "npm run build && prisma generate --schema=./backend/prisma/schema.prisma"
23
32
  },
24
33
  "dependencies": {
25
- "@prisma/client": "^5.14.0",
26
- "adm-zip": "^0.5.16",
27
- "archiver": "^7.0.1",
28
- "cron-parser": "^5.3.0",
29
- "express": "^4.19.2",
30
- "fs-extra": "^11.3.0",
31
- "mineflayer": "^4.20.1",
32
- "multer": "^2.0.1",
33
- "node-cron": "^4.1.0",
34
- "pidusage": "^3.0.2",
35
- "prisma": "^5.14.0",
36
- "semver": "^7.6.2",
37
- "socket.io": "^4.7.5",
38
- "socks": "^2.8.5"
34
+ "prisma": "^5.14.0"
39
35
  },
40
36
  "devDependencies": {
41
37
  "concurrently": "^8.2.2"
@@ -1 +0,0 @@
1
- export * from "./index"
@@ -1 +0,0 @@
1
- module.exports = { ...require('.') }
@@ -1 +0,0 @@
1
- export * from "./default"