vantuz 3.3.7 → 3.4.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/README.md +22 -64
- package/cli.js +0 -0
- package/core/ai-analyst.js +2 -2
- package/core/database.js +63 -72
- package/core/license-manager.js +9 -9
- package/index.js +175 -0
- package/modules/crm/sentiment-crm.js +231 -0
- package/modules/healer/listing-healer.js +201 -0
- package/modules/oracle/predictor.js +214 -0
- package/modules/researcher/agent.js +169 -0
- package/modules/team/agents/base.js +92 -0
- package/modules/team/agents/dev.js +33 -0
- package/modules/team/agents/josh.js +40 -0
- package/modules/team/agents/marketing.js +33 -0
- package/modules/team/agents/milo.js +36 -0
- package/modules/team/index.js +78 -0
- package/modules/team/shared-memory.js +87 -0
- package/modules/war-room/competitor-tracker.js +250 -0
- package/modules/war-room/pricing-engine.js +308 -0
- package/nodes/warehouse.js +238 -0
- package/onboard.js +0 -0
- package/package.json +47 -87
- package/platforms/amazon.js +3 -8
- package/platforms/ciceksepeti.js +2 -5
- package/platforms/hepsiburada.js +4 -6
- package/platforms/n11.js +3 -5
- package/platforms/pazarama.js +2 -5
- package/platforms/trendyol.js +3 -3
- package/plugins/vantuz/index.js +48 -0
- package/vantuz-3.3.4.tgz +0 -0
package/README.md
CHANGED
|
@@ -1,80 +1,38 @@
|
|
|
1
|
-
# 🐙
|
|
1
|
+
# 🐙 VANTUZ (Enterprise Edition)
|
|
2
2
|
|
|
3
|
-
**
|
|
3
|
+
**OpenClaw Altyapısıyla Güçlendirilmiş E-Ticaret Zekası**
|
|
4
4
|
|
|
5
|
-
Vantuz, sıradan bir entegrasyon aracı
|
|
5
|
+
Vantuz, sıradan bir entegrasyon aracı değildir. OpenClaw'ın yapay zeka ve otomasyon gücünü kullanarak e-ticaret operasyonlarınızı otopilota alan, ticari bir zekadır.
|
|
6
6
|
|
|
7
|
-
## 🚀
|
|
7
|
+
## 🚀 Neden Vantuz?
|
|
8
8
|
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
-
|
|
12
|
-
- **Marka Ruhu (`BRAND.md`):** "Kar marjım %15'in altına düşmesin", "Müşteriye senli benli konuşma" gibi kurallarınızı anayasası kabul eder.
|
|
13
|
-
|
|
14
|
-
### 👁️ Vision Intelligence
|
|
15
|
-
Sadece metin değil, görsellerle de çalışır.
|
|
16
|
-
- **Ürün Analizi:** Fotoğraftan ürün özelliklerini, materyalini ve tahmini fiyatını çıkarır.
|
|
17
|
-
- **Hasar Kontrolü:** İade gelen ürünün fotoğrafına bakıp "Hasarlı" veya "Yeniden Satılabilir" kararı verir.
|
|
18
|
-
- **Depo Gözü:** Depo kameralarına bağlanıp stok sayımı yapabilir.
|
|
19
|
-
|
|
20
|
-
### 🛡️ Critical Lane (Güvenli Şerit)
|
|
21
|
-
Hata yapma lüksü olmayan işlemler için özel koruma.
|
|
22
|
-
- **Serial Queue:** Aynı anda 100 fiyat güncelleme emri gelse bile, Vantuz bunları tek tek, sakince ve hatasız işler.
|
|
23
|
-
- **Dry-Run:** Kritik komutlar önce simülasyon modunda çalıştırılır, onaylanırsa gerçeğe dönüşür.
|
|
24
|
-
|
|
25
|
-
### 🔌 Genişletilebilir Uydu Modülleri (Nodes)
|
|
26
|
-
Vantuz sadece bilgisayarınızda değil, deponuzda da yaşar.
|
|
27
|
-
- **Warehouse Node:** Depo terminaline kurulan ufak bir modülle barkod okuma ve kamera entegrasyonu sağlar.
|
|
28
|
-
- **Webhooks:** Trendyol/Hepsiburada'dan gelen "Yeni Sipariş" bildirimini anında yakalar.
|
|
29
|
-
|
|
30
|
-
---
|
|
9
|
+
1. **AI Vision (Göz):** Ürün fotoğraflarını tanır, Trendyol/Amazon için başlık, açıklama ve fiyatı otomatik oluşturur.
|
|
10
|
+
2. **OpenClaw Entegrasyonu (Beyin):** Sistem arka planda çalışan OpenClaw Gateway ile konuşur. Web tarayıcısını kullanarak rakip fiyat analizi yapar, trendleri takip eder.
|
|
11
|
+
3. **Cross-Border (Kol):** Tek tuşla ürünlerinizi yurt dışı pazarlarına (Amazon DE, Etsy vb.) uyarlar.
|
|
31
12
|
|
|
32
13
|
## 📦 Kurulum
|
|
33
14
|
|
|
34
|
-
|
|
35
|
-
# Vantuz'u global olarak kurun
|
|
36
|
-
npm install -g vantuz
|
|
37
|
-
|
|
38
|
-
# Yapılandırma sihirbazını başlatın
|
|
39
|
-
vantuz config
|
|
40
|
-
```
|
|
41
|
-
|
|
42
|
-
## 🎮 Kullanım
|
|
15
|
+
Vantuz, **Node.js** tabanlıdır ancak son kullanıcı için tek bir `.exe` (Windows) veya Binary (Linux/Mac) olarak paketlenmiştir.
|
|
43
16
|
|
|
44
|
-
###
|
|
45
|
-
Vantuz ile sohbet ederek şirketinizi yönetin.
|
|
17
|
+
### Kaynak Koddan Kurulum (Geliştiriciler İçin)
|
|
46
18
|
|
|
47
19
|
```bash
|
|
48
|
-
vantuz
|
|
20
|
+
git clone https://github.com/vantuz-ai/core.git
|
|
21
|
+
cd vantuz
|
|
22
|
+
npm install
|
|
23
|
+
npm link
|
|
24
|
+
vantuz
|
|
49
25
|
```
|
|
50
26
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
- "Şu ürünün fotoğrafını analiz et ve Amazon Almanca açıklamasını yaz."
|
|
54
|
-
- "Son 1 saatte gelen iadelerin hasar durumunu raporla."
|
|
27
|
+
### Lisanslama
|
|
28
|
+
Sistemi ilk açtığınızda **Lisans Anahtarı** girmeniz istenecektir. Lisanssız kullanımda sadece "Demo Modu" (kısıtlı veri) çalışır.
|
|
55
29
|
|
|
56
|
-
|
|
30
|
+
## 🛠️ Desteklenen Platformlar
|
|
57
31
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
---
|
|
64
|
-
|
|
65
|
-
## 🏗️ Mimari
|
|
66
|
-
|
|
67
|
-
- **Core:** Node.js + Express
|
|
68
|
-
- **Memory:** JSON File Persistence + Vector Search
|
|
69
|
-
- **AI:** OpenAI GPT-4o / Google Gemini
|
|
70
|
-
- **Queue:** Serial Promise Queue
|
|
71
|
-
- **Gateway:** WebSocket Bridge
|
|
32
|
+
* ✅ **Trendyol** (Tam Entegrasyon)
|
|
33
|
+
* 🚧 **Hepsiburada** (Beta)
|
|
34
|
+
* 🚧 **Amazon** (Geliştiriliyor)
|
|
35
|
+
* 🚧 **N11** (Planlandı)
|
|
72
36
|
|
|
73
37
|
---
|
|
74
|
-
|
|
75
|
-
## 📄 Lisans
|
|
76
|
-
|
|
77
|
-
Ticari yazılım. Kullanım için lisans anahtarı gereklidir.
|
|
78
|
-
Yapımcı: **Nuri Can Avşar**
|
|
79
|
-
İletişim: nuricanavsar2000@gmail.com
|
|
80
|
-
Web: https://nuricanavsar.com
|
|
38
|
+
**Powered by OpenClaw Framework**
|
package/cli.js
CHANGED
|
File without changes
|
package/core/ai-analyst.js
CHANGED
|
@@ -7,7 +7,7 @@ module.exports = {
|
|
|
7
7
|
}
|
|
8
8
|
|
|
9
9
|
const prompt = `
|
|
10
|
-
|
|
10
|
+
Sen OmniMarket AI'ın uzman e-ticaret analistisin.
|
|
11
11
|
Aşağıdaki e-ticaret verilerini analiz et ve mağaza sahibine 3 adet kritik, eyleme dönüştürülebilir öneri sun.
|
|
12
12
|
Yanıtın kısa, net ve profesyonel olsun. Türkçe yanıt ver.
|
|
13
13
|
|
|
@@ -18,7 +18,7 @@ ${JSON.stringify(data, null, 2)}
|
|
|
18
18
|
try {
|
|
19
19
|
const baseURL = config.ai.baseUrl || 'https://api.openai.com/v1';
|
|
20
20
|
const model = config.ai.model || 'gpt-4-turbo';
|
|
21
|
-
|
|
21
|
+
|
|
22
22
|
// Generic OpenAI Compatible Endpoint Support (Works with DeepSeek, OpenAI, LocalAI)
|
|
23
23
|
const response = await axios.post(`${baseURL}/chat/completions`, {
|
|
24
24
|
model: model,
|
package/core/database.js
CHANGED
|
@@ -1,83 +1,74 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
import path from 'path';
|
|
5
|
-
import os from 'os';
|
|
6
|
-
import { fileURLToPath } from 'url'; // Import fileURLToPath
|
|
7
|
-
import { log } from './ai-provider.js';
|
|
1
|
+
const { Sequelize, DataTypes } = require('sequelize');
|
|
2
|
+
const path = require('path');
|
|
3
|
+
const fs = require('fs');
|
|
8
4
|
|
|
9
|
-
|
|
10
|
-
const
|
|
5
|
+
// Veritabanı dosyasının yolu (Kullanıcının home dizininde veya proje klasöründe)
|
|
6
|
+
const dbPath = path.join(process.cwd(), 'vantuz.sqlite');
|
|
11
7
|
|
|
12
|
-
const
|
|
8
|
+
const sequelize = new Sequelize({
|
|
9
|
+
dialect: 'sqlite',
|
|
10
|
+
storage: dbPath,
|
|
11
|
+
logging: false // Konsolu kirletmesin
|
|
12
|
+
});
|
|
13
13
|
|
|
14
|
-
|
|
15
|
-
constructor() {
|
|
16
|
-
this.db = null;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
async init() {
|
|
20
|
-
if (this.db) return this.db;
|
|
14
|
+
// --- MODELLER ---
|
|
21
15
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
});
|
|
30
|
-
log('INFO', 'SQLite database initialized and migrated');
|
|
31
|
-
return this.db;
|
|
32
|
-
} catch (error) {
|
|
33
|
-
log('ERROR', `Failed to initialize database: ${error.message}`, { error });
|
|
34
|
-
throw error;
|
|
35
|
-
}
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
async close() {
|
|
39
|
-
if (this.db) {
|
|
40
|
-
await this.db.close();
|
|
41
|
-
this.db = null;
|
|
42
|
-
log('INFO', 'SQLite database closed');
|
|
43
|
-
}
|
|
44
|
-
}
|
|
16
|
+
// Mağaza Ayarları (API Keyler vb.)
|
|
17
|
+
const Store = sequelize.define('Store', {
|
|
18
|
+
name: { type: DataTypes.STRING, allowNull: false },
|
|
19
|
+
platform: { type: DataTypes.STRING, allowNull: false }, // trendyol, amazon, etc.
|
|
20
|
+
credentials: { type: DataTypes.JSON, allowNull: false }, // { apiKey: '...', apiSecret: '...' }
|
|
21
|
+
isActive: { type: DataTypes.BOOLEAN, defaultValue: true }
|
|
22
|
+
});
|
|
45
23
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
}
|
|
24
|
+
// Ürünler
|
|
25
|
+
const Product = sequelize.define('Product', {
|
|
26
|
+
name: { type: DataTypes.STRING, allowNull: false },
|
|
27
|
+
barcode: { type: DataTypes.STRING, unique: true },
|
|
28
|
+
sku: { type: DataTypes.STRING },
|
|
29
|
+
description: { type: DataTypes.TEXT },
|
|
30
|
+
brand: { type: DataTypes.STRING },
|
|
31
|
+
images: { type: DataTypes.JSON }, // Resim URL'leri listesi
|
|
32
|
+
marketData: { type: DataTypes.JSON }, // { trendyol: { price: 100, stock: 10 }, amazon: { ... } }
|
|
33
|
+
aiAnalysis: { type: DataTypes.TEXT } // AI tarafından üretilen satış önerileri
|
|
34
|
+
});
|
|
55
35
|
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
36
|
+
// Siparişler
|
|
37
|
+
const Order = sequelize.define('Order', {
|
|
38
|
+
platform: { type: DataTypes.STRING, allowNull: false },
|
|
39
|
+
orderNumber: { type: DataTypes.STRING, unique: true },
|
|
40
|
+
customerName: { type: DataTypes.STRING },
|
|
41
|
+
totalAmount: { type: DataTypes.FLOAT },
|
|
42
|
+
currency: { type: DataTypes.STRING, defaultValue: 'TRY' },
|
|
43
|
+
status: { type: DataTypes.STRING },
|
|
44
|
+
orderDate: { type: DataTypes.DATE },
|
|
45
|
+
items: { type: DataTypes.JSON } // Sipariş içeriği
|
|
46
|
+
});
|
|
60
47
|
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
}
|
|
48
|
+
// Loglar ve AI Önerileri
|
|
49
|
+
const Insight = sequelize.define('Insight', {
|
|
50
|
+
type: { type: DataTypes.STRING }, // 'pricing', 'stock', 'trend'
|
|
51
|
+
message: { type: DataTypes.TEXT },
|
|
52
|
+
priority: { type: DataTypes.INTEGER }, // 1: Düşük, 5: Kritik
|
|
53
|
+
isRead: { type: DataTypes.BOOLEAN, defaultValue: false }
|
|
54
|
+
});
|
|
69
55
|
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
56
|
+
// Veritabanını Başlat
|
|
57
|
+
async function initDB() {
|
|
58
|
+
try {
|
|
59
|
+
await sequelize.sync({ alter: true }); // Tabloları güncelle
|
|
60
|
+
return true;
|
|
61
|
+
} catch (error) {
|
|
62
|
+
console.error('Veritabanı hatası:', error);
|
|
63
|
+
return false;
|
|
73
64
|
}
|
|
74
65
|
}
|
|
75
66
|
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
67
|
+
module.exports = {
|
|
68
|
+
sequelize,
|
|
69
|
+
Store,
|
|
70
|
+
Product,
|
|
71
|
+
Order,
|
|
72
|
+
Insight,
|
|
73
|
+
initDB
|
|
74
|
+
};
|
package/core/license-manager.js
CHANGED
|
@@ -4,13 +4,13 @@ const path = require('path');
|
|
|
4
4
|
|
|
5
5
|
// Müşteriye Gidecek Olan PUBLIC KEY (Sadece doğrulama yapar)
|
|
6
6
|
const PUBLIC_KEY = `-----BEGIN PUBLIC KEY-----
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
7
|
+
MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAvRNpoWJ4evHdT6I55/pE
|
|
8
|
+
Kly7N/vycRFavRP7Fsm3w/Ugfl+mdmxCZpjZVUXDWWT2d+I+XBh13g4ZmF9h0hVH
|
|
9
|
+
DklNBx6ikV9hax/zMu5auNLKf/IqAs9rM9ibdMaF2pxiiFelC0W2gmr1JDAbsU5o
|
|
10
|
+
+Znjs9WskTCxUjcHUpViPqPaRb39wo2UC25BtbHihXEIbx6mYJVXkg8ayFEcsKQc
|
|
11
|
+
FF10nTYaA1B0ENV9+mpda5etbaL7WFp6lfekYCDwJ8D78McNrGWDQSkQsJFgfzDL
|
|
12
|
+
ad+WCVh97rnXdlW3iQCGLXCN9ad1Ky8sw1C1tllEFQb3irOJvU0+s/8Pv829NLNh
|
|
13
|
+
iQIDAQAB
|
|
14
14
|
-----END PUBLIC KEY-----`;
|
|
15
15
|
|
|
16
16
|
// NOT: Bu dosya artık lisans ÜRETEMEZ. Sadece doğrular.
|
|
@@ -31,8 +31,8 @@ module.exports = {
|
|
|
31
31
|
verify.update(data);
|
|
32
32
|
verify.end();
|
|
33
33
|
|
|
34
|
-
// Gerçek Public Key'i
|
|
35
|
-
const pubKey =
|
|
34
|
+
// Gerçek Public Key'i kullan (Hardcoded)
|
|
35
|
+
const pubKey = PUBLIC_KEY;
|
|
36
36
|
|
|
37
37
|
const isValid = verify.verify(pubKey, signature, 'base64');
|
|
38
38
|
|
package/index.js
ADDED
|
@@ -0,0 +1,175 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
|
|
3
|
+
const fs = require('fs');
|
|
4
|
+
const clear = require('console-clear');
|
|
5
|
+
const figlet = require('figlet');
|
|
6
|
+
const chalk = require('chalk');
|
|
7
|
+
const inquirer = require('inquirer');
|
|
8
|
+
const boxen = require('boxen');
|
|
9
|
+
const ora = require('ora');
|
|
10
|
+
const Conf = require('conf');
|
|
11
|
+
const db = require('./core/database');
|
|
12
|
+
const licenseManager = require('./core/license-manager');
|
|
13
|
+
|
|
14
|
+
// ... (Diğer importlar aynı) ...
|
|
15
|
+
const productManager = require('./core/product-manager');
|
|
16
|
+
const platforms = {
|
|
17
|
+
trendyol: require('./platforms/trendyol')
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
const config = new Conf({ projectName: 'vantuz' });
|
|
21
|
+
|
|
22
|
+
// --- GİZLİ ADMIN MODU ---
|
|
23
|
+
// KODDAN SİLİNDİ. Lisans üretimi harici araçla yapılır.
|
|
24
|
+
|
|
25
|
+
const printHeader = () => {
|
|
26
|
+
clear();
|
|
27
|
+
console.log(chalk.cyan(figlet.textSync('VANTUZ', { horizontalLayout: 'full' })));
|
|
28
|
+
console.log(chalk.grey(' 🐙 E-Ticaretin Yapay Zeka Beyni | v2.2 Enterprise\n'));
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
async function main() {
|
|
32
|
+
printHeader();
|
|
33
|
+
|
|
34
|
+
// 1. Karşılama ve İlk Kurulum Kontrolü
|
|
35
|
+
const isFirstRun = !config.get('installed');
|
|
36
|
+
|
|
37
|
+
if (isFirstRun) {
|
|
38
|
+
await welcomeScreen();
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
// 2. Lisans Kontrolü
|
|
42
|
+
let licenseKey = config.get('licenseKey');
|
|
43
|
+
let licenseStatus = licenseKey ? licenseManager.verifyLicense(licenseKey) : { valid: false };
|
|
44
|
+
|
|
45
|
+
if (!licenseStatus.valid) {
|
|
46
|
+
if (licenseKey) console.log(chalk.red(`⚠️ Lisans Hatası: ${licenseStatus.reason}`));
|
|
47
|
+
|
|
48
|
+
console.log(boxen(chalk.white('🔒 VANTUZ Lisans Aktivasyonu\nDevam etmek için satıcınızdan aldığınız anahtarı girin.'), { padding: 1, borderColor: 'cyan', borderStyle: 'classic' }));
|
|
49
|
+
await activateLicense();
|
|
50
|
+
} else {
|
|
51
|
+
const daysLeft = Math.floor((new Date(licenseStatus.data.expiry) - new Date()) / (1000 * 60 * 60 * 24));
|
|
52
|
+
console.log(chalk.green(`✅ Lisanslı: ${licenseStatus.data.customer} (Kalan Süre: ${daysLeft} Gün)`));
|
|
53
|
+
await new Promise(r => setTimeout(r, 1000));
|
|
54
|
+
}
|
|
55
|
+
|
|
56
|
+
// 3. Veritabanı ve Sistem
|
|
57
|
+
const spinner = ora('Sistem nöronları başlatılıyor...').start();
|
|
58
|
+
await db.initDB();
|
|
59
|
+
spinner.succeed('Çekirdek Aktif');
|
|
60
|
+
|
|
61
|
+
// 4. Mağaza Kontrolü
|
|
62
|
+
const storeCount = await db.Store.count();
|
|
63
|
+
if (storeCount === 0) {
|
|
64
|
+
console.log(chalk.yellow('\n⚠️ Hiçbir mağaza bağlı değil.'));
|
|
65
|
+
await setupWizard();
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
// 5. Ana Döngü
|
|
69
|
+
while (true) {
|
|
70
|
+
printHeader();
|
|
71
|
+
await showDashboard(licenseStatus.data);
|
|
72
|
+
|
|
73
|
+
const { action } = await inquirer.prompt([
|
|
74
|
+
{
|
|
75
|
+
type: 'list',
|
|
76
|
+
name: 'action',
|
|
77
|
+
message: 'Komut Merkezi:',
|
|
78
|
+
choices: [
|
|
79
|
+
{ name: '📦 Sipariş Yönetimi', value: 'orders' },
|
|
80
|
+
{ name: '🛍️ Ürün & Stok (Vision AI)', value: 'products' },
|
|
81
|
+
{ name: '🧠 Pazar Analizi', value: 'ai' },
|
|
82
|
+
{ name: '⚙️ Ayarlar', value: 'settings' },
|
|
83
|
+
{ name: '🚪 Çıkış', value: 'exit' }
|
|
84
|
+
]
|
|
85
|
+
}
|
|
86
|
+
]);
|
|
87
|
+
|
|
88
|
+
if (action === 'exit') process.exit(0);
|
|
89
|
+
await handleAction(action);
|
|
90
|
+
}
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
async function welcomeScreen() {
|
|
94
|
+
clear();
|
|
95
|
+
console.log(chalk.cyan(figlet.textSync('Merhaba!', { horizontalLayout: 'full' })));
|
|
96
|
+
console.log(boxen(chalk.white(`
|
|
97
|
+
VANTUZ'a Hoşgeldiniz.
|
|
98
|
+
|
|
99
|
+
Bu yazılım, e-ticaret operasyonlarınızı yapay zeka ile yönetmenizi sağlar.
|
|
100
|
+
Kuruluma başlamadan önce lütfen şunları hazırlayın:
|
|
101
|
+
|
|
102
|
+
1. Lisans Anahtarınız
|
|
103
|
+
2. Pazaryeri API Bilgileriniz (Trendyol, Hepsiburada vb.)
|
|
104
|
+
3. (Opsiyonel) OpenAI API Anahtarı - Vision özelliği için
|
|
105
|
+
|
|
106
|
+
Başlamaya hazır mısınız?
|
|
107
|
+
`), { padding: 1, borderStyle: 'double', borderColor: 'green' }));
|
|
108
|
+
|
|
109
|
+
const { ready } = await inquirer.prompt([{ type: 'confirm', name: 'ready', message: 'Kuruluma Başla', default: true }]);
|
|
110
|
+
if (!ready) {
|
|
111
|
+
console.log(chalk.yellow('Kurulum iptal edildi. Çıkılıyor...'));
|
|
112
|
+
process.exit(0);
|
|
113
|
+
}
|
|
114
|
+
config.set('installed', true);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
async function activateLicense() {
|
|
118
|
+
const { key } = await inquirer.prompt([{ type: 'password', name: 'key', message: 'Lisans Anahtarı:', mask: '*' }]);
|
|
119
|
+
const spinner = ora('Anahtar doğrulanıyor...').start();
|
|
120
|
+
await new Promise(r => setTimeout(r, 1500)); // Dramatik bekleme
|
|
121
|
+
|
|
122
|
+
const status = licenseManager.verifyLicense(key);
|
|
123
|
+
|
|
124
|
+
if (status.valid) {
|
|
125
|
+
spinner.succeed(`Lisans Aktif: ${status.data.customer}`);
|
|
126
|
+
config.set('licenseKey', key);
|
|
127
|
+
await new Promise(r => setTimeout(r, 1000));
|
|
128
|
+
} else {
|
|
129
|
+
spinner.fail(`Hata: ${status.reason}`);
|
|
130
|
+
console.log(chalk.yellow('Lütfen geçerli bir anahtar girin veya satıcınızla görüşün.'));
|
|
131
|
+
process.exit(1);
|
|
132
|
+
}
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
// ... (setupWizard, showDashboard, handleAction fonksiyonları aynı kalacak, sadece ufak revizyonlar) ...
|
|
136
|
+
|
|
137
|
+
// setupWizard fonksiyonunu güncelleme (Mağaza kurulumu)
|
|
138
|
+
async function setupWizard() {
|
|
139
|
+
console.log(chalk.bold('\n🛒 Mağaza Bağlantı Sihirbazı\n'));
|
|
140
|
+
const { storeName } = await inquirer.prompt([{ type: 'input', name: 'storeName', message: 'Mağaza Adı:' }]);
|
|
141
|
+
|
|
142
|
+
// Platform seçimi ve API girişi buraya gelecek (önceki koddan)
|
|
143
|
+
// ...
|
|
144
|
+
|
|
145
|
+
// Demo için sadece Trendyol ekleyelim
|
|
146
|
+
console.log(chalk.cyan('\n👉 Trendyol Entegrasyonu:'));
|
|
147
|
+
const creds = await inquirer.prompt([
|
|
148
|
+
{ type: 'password', name: 'supplierId', message: 'Supplier ID:', mask: '*' },
|
|
149
|
+
{ type: 'password', name: 'apiKey', message: 'API Key:', mask: '*' },
|
|
150
|
+
{ type: 'password', name: 'apiSecret', message: 'API Secret:', mask: '*' }
|
|
151
|
+
]);
|
|
152
|
+
|
|
153
|
+
await db.Store.create({ name: storeName, platform: 'trendyol', credentials: creds });
|
|
154
|
+
console.log(chalk.green('\n✅ Mağaza Bağlandı!'));
|
|
155
|
+
await new Promise(r => setTimeout(r, 1500));
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
async function showDashboard(licenseData) {
|
|
159
|
+
const stores = await db.Store.findAll();
|
|
160
|
+
const orders = await db.Order.count();
|
|
161
|
+
|
|
162
|
+
console.log(chalk.bold(`🏢 Lisans Sahibi: ${chalk.cyan(licenseData.customer)}`));
|
|
163
|
+
console.log(`📦 Aktif Mağazalar: ${stores.length} | Toplam Sipariş: ${orders}`);
|
|
164
|
+
console.log(chalk.grey('----------------------------------------'));
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
async function handleAction(action) {
|
|
168
|
+
if (action === 'products') await productManager.manageProducts();
|
|
169
|
+
// Diğer aksiyonlar...
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
main().catch(err => {
|
|
173
|
+
console.error(err);
|
|
174
|
+
process.exit(1);
|
|
175
|
+
});
|