vantuz 3.4.1 → 3.5.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/LICENSE +45 -45
- package/admin-keygen.js +51 -0
- package/cli.js +685 -585
- package/config.js +733 -733
- package/core/agent-loop.js +190 -190
- package/core/ai-provider.js +298 -261
- package/core/automation.js +523 -523
- package/core/brand-analyst.js +101 -0
- package/core/channels.js +167 -167
- package/core/dashboard.js +230 -230
- package/core/database.js +135 -36
- package/core/eia-monitor.js +3 -1
- package/core/engine.js +648 -636
- package/core/gateway.js +447 -447
- package/core/learning.js +214 -214
- package/core/license.js +113 -0
- package/core/marketplace-adapter.js +168 -168
- package/core/memory.js +190 -190
- package/core/migrations/001-initial-schema.sql +1 -1
- package/core/queue.js +120 -120
- package/core/self-healer.js +314 -314
- package/core/unified-product.js +214 -214
- package/core/vision-service.js +113 -113
- package/index.js +217 -174
- package/modules/crm/sentiment-crm.js +231 -231
- package/modules/healer/listing-healer.js +201 -201
- package/modules/oracle/predictor.js +214 -214
- package/modules/researcher/agent.js +169 -169
- package/modules/team/agents/base.js +92 -92
- package/modules/team/agents/dev.js +33 -33
- package/modules/team/agents/josh.js +40 -40
- package/modules/team/agents/marketing.js +33 -33
- package/modules/team/agents/milo.js +36 -36
- package/modules/team/index.js +78 -78
- package/modules/team/shared-memory.js +87 -87
- package/modules/war-room/competitor-tracker.js +250 -250
- package/modules/war-room/pricing-engine.js +308 -308
- package/nodes/warehouse.js +238 -238
- package/onboard.js +1 -1
- package/package.json +7 -6
- package/platforms/pttavm.js +14 -14
- package/plugins/vantuz/index.js +528 -528
- package/plugins/vantuz/memory/hippocampus.js +465 -464
- package/plugins/vantuz/package.json +20 -20
- package/plugins/vantuz/platforms/_template.js +118 -118
- package/plugins/vantuz/platforms/amazon.js +236 -236
- package/plugins/vantuz/platforms/ciceksepeti.js +166 -166
- package/plugins/vantuz/platforms/hepsiburada.js +180 -180
- package/plugins/vantuz/platforms/index.js +165 -165
- package/plugins/vantuz/platforms/n11.js +229 -229
- package/plugins/vantuz/platforms/pazarama.js +154 -154
- package/plugins/vantuz/platforms/pttavm.js +127 -127
- package/plugins/vantuz/platforms/trendyol.js +326 -326
- package/plugins/vantuz/services/alerts.js +253 -253
- package/plugins/vantuz/services/license.js +34 -34
- package/plugins/vantuz/services/scheduler.js +232 -232
- package/plugins/vantuz/tools/analytics.js +152 -152
- package/plugins/vantuz/tools/crossborder.js +187 -187
- package/plugins/vantuz/tools/nl-parser.js +211 -211
- package/plugins/vantuz/tools/product.js +110 -110
- package/plugins/vantuz/tools/quick-report.js +175 -175
- package/plugins/vantuz/tools/repricer.js +314 -314
- package/plugins/vantuz/tools/sentiment.js +115 -115
- package/plugins/vantuz/tools/vision.js +257 -257
- package/private.pem +28 -0
- package/public.pem +9 -0
- package/server/app.js +260 -260
- package/server/public/index.html +514 -514
- package/start.bat +33 -33
- package/vantuz.sqlite +0 -0
package/index.js
CHANGED
|
@@ -1,175 +1,218 @@
|
|
|
1
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
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
//
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
console.log(chalk.
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
let
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
{ name: '
|
|
81
|
-
{ name: '
|
|
82
|
-
{ name: '
|
|
83
|
-
{ name: '
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
}
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
await
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
// setupWizard
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
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 brandAnalyst = require('./core/brand-analyst');
|
|
17
|
+
const platforms = {
|
|
18
|
+
trendyol: require('./platforms/trendyol')
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
const config = new Conf({ projectName: 'vantuz' });
|
|
22
|
+
|
|
23
|
+
// --- GİZLİ ADMIN MODU ---
|
|
24
|
+
// KODDAN SİLİNDİ. Lisans üretimi harici araçla yapılır.
|
|
25
|
+
|
|
26
|
+
const printHeader = () => {
|
|
27
|
+
clear();
|
|
28
|
+
console.log(chalk.cyan(figlet.textSync('VANTUZ', { horizontalLayout: 'full' })));
|
|
29
|
+
console.log(chalk.grey(' 🐙 E-Ticaretin Yapay Zeka Beyni | v2.2 Enterprise\n'));
|
|
30
|
+
};
|
|
31
|
+
|
|
32
|
+
async function main() {
|
|
33
|
+
printHeader();
|
|
34
|
+
|
|
35
|
+
// 1. Karşılama ve İlk Kurulum Kontrolü
|
|
36
|
+
const isFirstRun = !config.get('installed');
|
|
37
|
+
|
|
38
|
+
if (isFirstRun) {
|
|
39
|
+
await welcomeScreen();
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
// 2. Lisans Kontrolü
|
|
43
|
+
let licenseKey = config.get('licenseKey');
|
|
44
|
+
let licenseStatus = licenseKey ? licenseManager.verifyLicense(licenseKey) : { valid: false };
|
|
45
|
+
|
|
46
|
+
if (!licenseStatus.valid) {
|
|
47
|
+
if (licenseKey) console.log(chalk.red(`⚠️ Lisans Hatası: ${licenseStatus.reason}`));
|
|
48
|
+
|
|
49
|
+
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' }));
|
|
50
|
+
await activateLicense();
|
|
51
|
+
} else {
|
|
52
|
+
const daysLeft = Math.floor((new Date(licenseStatus.data.expiry) - new Date()) / (1000 * 60 * 60 * 24));
|
|
53
|
+
console.log(chalk.green(`✅ Lisanslı: ${licenseStatus.data.customer} (Kalan Süre: ${daysLeft} Gün)`));
|
|
54
|
+
await new Promise(r => setTimeout(r, 1000));
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
// 3. Veritabanı ve Sistem
|
|
58
|
+
const spinner = ora('Sistem nöronları başlatılıyor...').start();
|
|
59
|
+
await db.initDB();
|
|
60
|
+
spinner.succeed('Çekirdek Aktif');
|
|
61
|
+
|
|
62
|
+
// 4. Mağaza Kontrolü
|
|
63
|
+
const storeCount = await db.Store.count();
|
|
64
|
+
if (storeCount === 0) {
|
|
65
|
+
console.log(chalk.yellow('\n⚠️ Hiçbir mağaza bağlı değil.'));
|
|
66
|
+
await setupWizard();
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
// 5. Ana Döngü
|
|
70
|
+
while (true) {
|
|
71
|
+
printHeader();
|
|
72
|
+
await showDashboard(licenseStatus.data);
|
|
73
|
+
|
|
74
|
+
const { action } = await inquirer.prompt([
|
|
75
|
+
{
|
|
76
|
+
type: 'list',
|
|
77
|
+
name: 'action',
|
|
78
|
+
message: 'Komut Merkezi:',
|
|
79
|
+
choices: [
|
|
80
|
+
{ name: '📦 Sipariş Yönetimi', value: 'orders' },
|
|
81
|
+
{ name: '🛍️ Ürün & Stok (Vision AI)', value: 'products' },
|
|
82
|
+
{ name: '🧠 Pazar Analizi', value: 'ai' },
|
|
83
|
+
{ name: '➕ Mağaza Ekle', value: 'add_store' },
|
|
84
|
+
{ name: '⚙️ Ayarlar', value: 'settings' },
|
|
85
|
+
{ name: '🚪 Çıkış', value: 'exit' }
|
|
86
|
+
]
|
|
87
|
+
}
|
|
88
|
+
]);
|
|
89
|
+
|
|
90
|
+
if (action === 'exit') process.exit(0);
|
|
91
|
+
await handleAction(action);
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
async function welcomeScreen() {
|
|
96
|
+
clear();
|
|
97
|
+
console.log(chalk.cyan(figlet.textSync('Merhaba!', { horizontalLayout: 'full' })));
|
|
98
|
+
console.log(boxen(chalk.white(`
|
|
99
|
+
VANTUZ'a Hoşgeldiniz.
|
|
100
|
+
|
|
101
|
+
Bu yazılım, e-ticaret operasyonlarınızı yapay zeka ile yönetmenizi sağlar.
|
|
102
|
+
Kuruluma başlamadan önce lütfen şunları hazırlayın:
|
|
103
|
+
|
|
104
|
+
1. Lisans Anahtarınız
|
|
105
|
+
2. Pazaryeri API Bilgileriniz (Trendyol, Hepsiburada vb.)
|
|
106
|
+
3. (Opsiyonel) OpenAI API Anahtarı - Vision özelliği için
|
|
107
|
+
|
|
108
|
+
Başlamaya hazır mısınız?
|
|
109
|
+
`), { padding: 1, borderStyle: 'double', borderColor: 'green' }));
|
|
110
|
+
|
|
111
|
+
const { ready } = await inquirer.prompt([{ type: 'confirm', name: 'ready', message: 'Kuruluma Başla', default: true }]);
|
|
112
|
+
if (!ready) {
|
|
113
|
+
console.log(chalk.yellow('Kurulum iptal edildi. Çıkılıyor...'));
|
|
114
|
+
process.exit(0);
|
|
115
|
+
}
|
|
116
|
+
config.set('installed', true);
|
|
117
|
+
}
|
|
118
|
+
|
|
119
|
+
async function activateLicense() {
|
|
120
|
+
const { key } = await inquirer.prompt([{ type: 'password', name: 'key', message: 'Lisans Anahtarı:', mask: '*' }]);
|
|
121
|
+
const spinner = ora('Anahtar doğrulanıyor...').start();
|
|
122
|
+
await new Promise(r => setTimeout(r, 1500)); // Dramatik bekleme
|
|
123
|
+
|
|
124
|
+
const status = licenseManager.verifyLicense(key);
|
|
125
|
+
|
|
126
|
+
if (status.valid) {
|
|
127
|
+
spinner.succeed(`Lisans Aktif: ${status.data.customer}`);
|
|
128
|
+
config.set('licenseKey', key);
|
|
129
|
+
await new Promise(r => setTimeout(r, 1000));
|
|
130
|
+
} else {
|
|
131
|
+
spinner.fail(`Hata: ${status.reason}`);
|
|
132
|
+
console.log(chalk.yellow('Lütfen geçerli bir anahtar girin veya satıcınızla görüşün.'));
|
|
133
|
+
process.exit(1);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
// ... (setupWizard, showDashboard, handleAction fonksiyonları aynı kalacak, sadece ufak revizyonlar) ...
|
|
138
|
+
|
|
139
|
+
// setupWizard fonksiyonunu güncelleme (Mağaza kurulumu)
|
|
140
|
+
async function setupWizard() {
|
|
141
|
+
console.log(chalk.bold('\n🛒 Mağaza Bağlantı Sihirbazı\n'));
|
|
142
|
+
const { storeName } = await inquirer.prompt([{ type: 'input', name: 'storeName', message: 'Mağaza Adı:' }]);
|
|
143
|
+
|
|
144
|
+
const { platform } = await inquirer.prompt([
|
|
145
|
+
{
|
|
146
|
+
type: 'list',
|
|
147
|
+
name: 'platform',
|
|
148
|
+
message: 'Pazaryeri Seçin:',
|
|
149
|
+
choices: [
|
|
150
|
+
{ name: '🟧 Trendyol', value: 'trendyol' },
|
|
151
|
+
{ name: '🟧 Hepsiburada', value: 'hepsiburada' },
|
|
152
|
+
{ name: '🐞 N11', value: 'n11' },
|
|
153
|
+
{ name: '📦 Amazon (SP-API)', value: 'amazon' }
|
|
154
|
+
]
|
|
155
|
+
}
|
|
156
|
+
]);
|
|
157
|
+
|
|
158
|
+
let creds = {};
|
|
159
|
+
|
|
160
|
+
if (platform === 'trendyol') {
|
|
161
|
+
console.log(chalk.cyan('\n👉 Trendyol Entegrasyonu:'));
|
|
162
|
+
creds = await inquirer.prompt([
|
|
163
|
+
{ type: 'password', name: 'supplierId', message: 'Supplier ID:', mask: '*' },
|
|
164
|
+
{ type: 'password', name: 'apiKey', message: 'API Key:', mask: '*' },
|
|
165
|
+
{ type: 'password', name: 'apiSecret', message: 'API Secret:', mask: '*' }
|
|
166
|
+
]);
|
|
167
|
+
} else if (platform === 'hepsiburada') {
|
|
168
|
+
console.log(chalk.cyan('\n👉 Hepsiburada Entegrasyonu:'));
|
|
169
|
+
creds = await inquirer.prompt([
|
|
170
|
+
{ type: 'input', name: 'merchantId', message: 'Merchant ID:' },
|
|
171
|
+
{ type: 'password', name: 'username', message: 'Username (MP):', mask: '*' },
|
|
172
|
+
{ type: 'password', name: 'password', message: 'Password:', mask: '*' }
|
|
173
|
+
]);
|
|
174
|
+
} else if (platform === 'n11') {
|
|
175
|
+
console.log(chalk.cyan('\n👉 N11 Entegrasyonu:'));
|
|
176
|
+
creds = await inquirer.prompt([
|
|
177
|
+
{ type: 'password', name: 'apiKey', message: 'API Key:', mask: '*' },
|
|
178
|
+
{ type: 'password', name: 'apiSecret', message: 'API Secret:', mask: '*' }
|
|
179
|
+
]);
|
|
180
|
+
} else if (platform === 'amazon') {
|
|
181
|
+
console.log(chalk.cyan('\n👉 Amazon SP-API Entegrasyonu:'));
|
|
182
|
+
creds = await inquirer.prompt([
|
|
183
|
+
{ type: 'input', name: 'sellerId', message: 'Seller ID:' },
|
|
184
|
+
{ type: 'password', name: 'clientId', message: 'Client ID:', mask: '*' },
|
|
185
|
+
{ type: 'password', name: 'clientSecret', message: 'Client Secret:', mask: '*' },
|
|
186
|
+
{ type: 'password', name: 'refreshToken', message: 'Refresh Token:', mask: '*' },
|
|
187
|
+
{ type: 'list', name: 'region', message: 'Bölge:', choices: ['eu', 'na', 'tr'], default: 'tr' }
|
|
188
|
+
]);
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
await db.Store.create({ name: storeName, platform, credentials: creds });
|
|
192
|
+
console.log(chalk.green(`\n✅ ${storeName} (${platform}) Başarıyla Bağlandı!`));
|
|
193
|
+
|
|
194
|
+
// AI Brand Analysis
|
|
195
|
+
await brandAnalyst.analyzeAndSave(storeName, config);
|
|
196
|
+
|
|
197
|
+
await new Promise(r => setTimeout(r, 1500));
|
|
198
|
+
}
|
|
199
|
+
|
|
200
|
+
async function showDashboard(licenseData) {
|
|
201
|
+
const stores = await db.Store.findAll();
|
|
202
|
+
const orders = await db.Order.count();
|
|
203
|
+
|
|
204
|
+
console.log(chalk.bold(`🏢 Lisans Sahibi: ${chalk.cyan(licenseData.customer)}`));
|
|
205
|
+
console.log(`📦 Aktif Mağazalar: ${stores.length} | Toplam Sipariş: ${orders}`);
|
|
206
|
+
console.log(chalk.grey('----------------------------------------'));
|
|
207
|
+
}
|
|
208
|
+
|
|
209
|
+
async function handleAction(action) {
|
|
210
|
+
if (action === 'products') await productManager.manageProducts();
|
|
211
|
+
if (action === 'add_store') await setupWizard();
|
|
212
|
+
// Diğer aksiyonlar...
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
main().catch(err => {
|
|
216
|
+
console.error(err);
|
|
217
|
+
process.exit(1);
|
|
218
|
+
});
|