devcode-canavar-pro 3.3.0

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/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "devcode-canavar-pro",
3
+ "version": "3.3.0",
4
+ "description": "Monster Edition: Ultra-fast, zero-config, embedded document database with Visual Dashboard and Interactive CLI.",
5
+ "main": "index.js",
6
+ "bin": {
7
+ "devcode": "bin/devcode.js"
8
+ },
9
+ "scripts": {
10
+ "start": "node bin/devcode.js",
11
+ "vds-setup": "node vds_setup.js",
12
+ "vds": "node vds_start.js",
13
+ "test": "node test.js"
14
+ },
15
+ "keywords": [
16
+ "database",
17
+ "nosql",
18
+ "mongodb",
19
+ "embedded",
20
+ "fast",
21
+ "json",
22
+ "dashboard",
23
+ "cli",
24
+ "storage"
25
+ ],
26
+ "author": "Baran",
27
+ "license": "MIT",
28
+ "dependencies": {},
29
+ "engines": {
30
+ "node": ">=14.0.0"
31
+ },
32
+ "repository": {
33
+ "type": "git",
34
+ "url": "https://github.com/baran/devcode"
35
+ }
36
+ }
package/test_uri.js ADDED
@@ -0,0 +1,31 @@
1
+ const devcode = require('./index');
2
+
3
+ async function test() {
4
+ console.log('--- DBaaS Connection URI Testi Başlıyor ---');
5
+
6
+ try {
7
+ // 1. Connection URI ile bağlan (Yerel sunucuyu simüle et)
8
+ // Format: devcode://anahtar@localhost:4242
9
+ const db = devcode.connect('devcode://test_secret@localhost:4242');
10
+ console.log('✅ Bağlantı objesi oluşturuldu.');
11
+
12
+ const users = db.use('cloud_db').collection('users');
13
+
14
+ // 2. Veri Ekleme (Uzak sunucu çalışmıyor olabilir, sadece URI parsing'i test ediyoruz)
15
+ console.log('URI Parsing Kontrolü:');
16
+ console.log('- Host:', db.host);
17
+ console.log('- Port:', db.port);
18
+ console.log('- Secret:', db.secret);
19
+
20
+ if (db.host === 'localhost' && db.port === 4242 && db.secret === 'test_secret') {
21
+ console.log('✅ TEST BAŞARILI: Connection URI doğru parse edildi!');
22
+ } else {
23
+ console.log('❌ TEST HATALI: URI bilgileri yanlış.');
24
+ }
25
+
26
+ } catch (error) {
27
+ console.error('❌ Hata:', error.message);
28
+ }
29
+ }
30
+
31
+ test();
package/vds.js ADDED
@@ -0,0 +1,49 @@
1
+ const DevCode = require('./index');
2
+ const fs = require('fs');
3
+ const path = require('path');
4
+
5
+ // Yapılandırmayı yükle
6
+ const configPath = path.join(__dirname, 'vds_config.json');
7
+ let config = {
8
+ port: 4242,
9
+ secret: 'devcode_secret',
10
+ dashboard: true,
11
+ dashboardPort: 3000,
12
+ dataPath: path.join(__dirname, 'data')
13
+ };
14
+
15
+ if (fs.existsSync(configPath)) {
16
+ try {
17
+ const fileConfig = JSON.parse(fs.readFileSync(configPath, 'utf8'));
18
+ config = { ...config, ...fileConfig };
19
+ console.log('\x1b[32m[VDS]\x1b[0m Yapılandırma dosyası yüklendi.');
20
+ } catch (e) {
21
+ console.error('\x1b[31m[VDS]\x1b[0m Yapılandırma dosyası okunamadı, varsayılanlar kullanılıyor.');
22
+ }
23
+ } else {
24
+ console.log('\x1b[33m[VDS]\x1b[0m Yapılandırma dosyası bulunamadı, varsayılanlar kullanılıyor.');
25
+ }
26
+
27
+ // Veritabanını başlat
28
+ const db = new DevCode({
29
+ dataPath: config.dataPath,
30
+ backup: config.backup || false
31
+ });
32
+
33
+ console.log('\n\x1b[36m=========================================');
34
+ console.log(' DevCode MONSTER - VDS DATA CENTER');
35
+ console.log('=========================================\x1b[0m\n');
36
+
37
+ // Uzak bağlantı sunucusunu başlat
38
+ db.startServer({
39
+ port: config.port,
40
+ secret: config.secret
41
+ });
42
+
43
+ // Dashboard'u başlat (isteğe bağlı)
44
+ if (config.dashboard) {
45
+ db.startDashboard(config.dashboardPort);
46
+ }
47
+
48
+ console.log(`\n\x1b[32m[Sistem]\x1b[0m Veri merkezi şu an VDS üzerinde aktif!`);
49
+ console.log(`\x1b[32m[Bilgi]\x1b[0m Diğer botlarınızdan bağlanmak için RemoteClient kullanın.`);
package/vds_setup.js ADDED
@@ -0,0 +1,36 @@
1
+ const fs = require('fs');
2
+ const path = require('path');
3
+
4
+ console.log('\n--- 🦕 DevCode MONSTER: VDS Sunucu Kurulumu ---');
5
+
6
+ const configPath = path.join(__dirname, 'vds_config.json');
7
+ const defaultConfig = {
8
+ port: 4242,
9
+ secret: "devcode_monster_2026",
10
+ dashboard: true,
11
+ dashboardPort: 3000,
12
+ dataPath: "./data",
13
+ backup: {
14
+ enabled: true,
15
+ interval: 3600,
16
+ maxBackups: 10
17
+ }
18
+ };
19
+
20
+ try {
21
+ // Veri dizinini oluştur
22
+ const dataDir = path.join(__dirname, 'data');
23
+ if (!fs.existsSync(dataDir)) {
24
+ fs.mkdirSync(dataDir);
25
+ console.log('✅ Veri klasörü oluşturuldu: /data');
26
+ }
27
+
28
+ // Config dosyasını oluştur veya güncelle
29
+ fs.writeFileSync(configPath, JSON.stringify(defaultConfig, null, 4));
30
+ console.log('✅ vds_config.json hazırlandı.');
31
+
32
+ console.log('\n🚀 KURULUM TAMAMLANDI!');
33
+ console.log('Sunucuyu başlatmak için: npm run vds');
34
+ } catch (error) {
35
+ console.error('❌ Kurulum hatası:', error.message);
36
+ }
package/vds_start.js ADDED
@@ -0,0 +1,27 @@
1
+ const { Server } = require('./index');
2
+ const fs = require('fs');
3
+ const path = require('path');
4
+
5
+ // Config oku
6
+ const configPath = path.join(__dirname, 'vds_config.json');
7
+ const config = JSON.parse(fs.readFileSync(configPath, 'utf8'));
8
+
9
+ console.log('\n--- 🦕 DevCode MONSTER: VDS Veri Merkezi Başlatılıyor ---');
10
+ console.log(`📍 IP: 45.74.244.192`);
11
+ console.log(`🔑 Gizli Anahtar: ${config.secret}`);
12
+
13
+ const server = new Server({
14
+ dataPath: config.dataPath,
15
+ secret: config.secret
16
+ });
17
+
18
+ // Sunucuyu başlat (Port: 4242)
19
+ server.startServer(config.port);
20
+
21
+ // Görsel Paneli başlat (Port: 3000)
22
+ if (config.dashboard) {
23
+ server.startDashboard(config.dashboardPort);
24
+ }
25
+
26
+ // Shell'i başlat (VDS üzerinde kontrol için)
27
+ server.startShell();