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
|
@@ -1,152 +1,152 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 📊 Analytics Tool
|
|
3
|
-
* Satış, stok ve performans raporları
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
export const analyticsTool = {
|
|
7
|
-
name: 'analytics',
|
|
8
|
-
|
|
9
|
-
async execute(params, context) {
|
|
10
|
-
const { api, memory } = context;
|
|
11
|
-
const { reportType, platform = 'all', period = '7d' } = params;
|
|
12
|
-
|
|
13
|
-
switch (reportType) {
|
|
14
|
-
case 'sales':
|
|
15
|
-
return await this._salesReport(platform, period, context);
|
|
16
|
-
case 'stock':
|
|
17
|
-
return await this._stockReport(platform, context);
|
|
18
|
-
case 'profit':
|
|
19
|
-
return await this._profitReport(platform, period, context);
|
|
20
|
-
case 'competitors':
|
|
21
|
-
return await this._competitorReport(platform, context);
|
|
22
|
-
case 'trends':
|
|
23
|
-
return await this._trendsReport(context);
|
|
24
|
-
default:
|
|
25
|
-
return { success: false, error: 'Geçersiz rapor türü' };
|
|
26
|
-
}
|
|
27
|
-
},
|
|
28
|
-
|
|
29
|
-
async getSalesReport(period, context) {
|
|
30
|
-
// TODO: Gerçek verilerle
|
|
31
|
-
const periodDays = this._parsePeriod(period);
|
|
32
|
-
|
|
33
|
-
return {
|
|
34
|
-
period,
|
|
35
|
-
revenue: 125750.90,
|
|
36
|
-
orders: 342,
|
|
37
|
-
avgBasket: 367.69,
|
|
38
|
-
topProduct: 'iPhone 15 Pro Kılıf - Siyah',
|
|
39
|
-
growth: '+12%',
|
|
40
|
-
platforms: {
|
|
41
|
-
trendyol: { revenue: 75000, orders: 205 },
|
|
42
|
-
hepsiburada: { revenue: 35000, orders: 95 },
|
|
43
|
-
n11: { revenue: 15750.90, orders: 42 }
|
|
44
|
-
}
|
|
45
|
-
};
|
|
46
|
-
},
|
|
47
|
-
|
|
48
|
-
async _salesReport(platform, period, context) {
|
|
49
|
-
const data = await this.getSalesReport(period, context);
|
|
50
|
-
|
|
51
|
-
return {
|
|
52
|
-
success: true,
|
|
53
|
-
report: data,
|
|
54
|
-
insights: [
|
|
55
|
-
`📈 Geçen ${period}'e göre satışlar %12 arttı.`,
|
|
56
|
-
`🏆 En çok satan ürün: ${data.topProduct}`,
|
|
57
|
-
`💰 Ortalama sepet tutarı: ${data.avgBasket.toFixed(2)} ₺`
|
|
58
|
-
]
|
|
59
|
-
};
|
|
60
|
-
},
|
|
61
|
-
|
|
62
|
-
async _stockReport(platform, context) {
|
|
63
|
-
return {
|
|
64
|
-
success: true,
|
|
65
|
-
report: {
|
|
66
|
-
totalProducts: 1532,
|
|
67
|
-
totalStock: 45680,
|
|
68
|
-
criticalStock: 45,
|
|
69
|
-
outOfStock: 12,
|
|
70
|
-
overstock: 23
|
|
71
|
-
},
|
|
72
|
-
alerts: [
|
|
73
|
-
'⚠️ 45 ürün kritik stok seviyesinde (<5 adet)',
|
|
74
|
-
'❌ 12 ürün stok dışı',
|
|
75
|
-
'📦 23 ürün fazla stoklu (>100 adet, 90 gündür satış yok)'
|
|
76
|
-
],
|
|
77
|
-
actionRequired: [
|
|
78
|
-
{ sku: 'SKU-001', name: 'iPhone Kılıf', stock: 2, action: 'Sipariş ver' },
|
|
79
|
-
{ sku: 'SKU-002', name: 'Samsung Kılıf', stock: 0, action: 'Acil tedarik' }
|
|
80
|
-
]
|
|
81
|
-
};
|
|
82
|
-
},
|
|
83
|
-
|
|
84
|
-
async _profitReport(platform, period, context) {
|
|
85
|
-
return {
|
|
86
|
-
success: true,
|
|
87
|
-
report: {
|
|
88
|
-
revenue: 125750.90,
|
|
89
|
-
costs: 78500.00,
|
|
90
|
-
grossProfit: 47250.90,
|
|
91
|
-
profitMargin: '37.6%',
|
|
92
|
-
topProfitProducts: [
|
|
93
|
-
{ name: 'Premium Kılıf', profit: 8500, margin: '45%' },
|
|
94
|
-
{ name: 'Wireless Şarj', profit: 6200, margin: '42%' }
|
|
95
|
-
],
|
|
96
|
-
lowMarginProducts: [
|
|
97
|
-
{ name: 'Basic Kılıf', margin: '12%', recommendation: 'Fiyat artır' }
|
|
98
|
-
]
|
|
99
|
-
}
|
|
100
|
-
};
|
|
101
|
-
},
|
|
102
|
-
|
|
103
|
-
async _competitorReport(platform, context) {
|
|
104
|
-
return {
|
|
105
|
-
success: true,
|
|
106
|
-
report: {
|
|
107
|
-
tracked: 150,
|
|
108
|
-
priceAdvantage: 45,
|
|
109
|
-
priceDisadvantage: 32,
|
|
110
|
-
priceParity: 73
|
|
111
|
-
},
|
|
112
|
-
opportunities: [
|
|
113
|
-
{ product: 'iPhone 15 Kılıf', yourPrice: 199, avgCompetitor: 229, action: 'Fiyat artırabilirsin' },
|
|
114
|
-
{ product: 'Samsung Kılıf', yourPrice: 149, avgCompetitor: 129, action: 'Rakipler daha ucuz' }
|
|
115
|
-
]
|
|
116
|
-
};
|
|
117
|
-
},
|
|
118
|
-
|
|
119
|
-
async _trendsReport(context) {
|
|
120
|
-
return {
|
|
121
|
-
success: true,
|
|
122
|
-
report: {
|
|
123
|
-
rising: [
|
|
124
|
-
{ term: 'MagSafe şarj', growth: '+420%', volume: 12500 },
|
|
125
|
-
{ term: 'iPhone 15 kılıf', growth: '+180%', volume: 45000 }
|
|
126
|
-
],
|
|
127
|
-
falling: [
|
|
128
|
-
{ term: 'iPhone 12 kılıf', decline: '-35%' }
|
|
129
|
-
]
|
|
130
|
-
},
|
|
131
|
-
recommendations: [
|
|
132
|
-
'🔥 MagSafe ürünleri trend! Envantere ekle.',
|
|
133
|
-
'📉 iPhone 12 aksesuarları düşüşte, stoğu eritmeye odaklan.'
|
|
134
|
-
]
|
|
135
|
-
};
|
|
136
|
-
},
|
|
137
|
-
|
|
138
|
-
_parsePeriod(period) {
|
|
139
|
-
const match = period.match(/(\d+)([dhm])/);
|
|
140
|
-
if (!match) return 7;
|
|
141
|
-
|
|
142
|
-
const value = parseInt(match[1]);
|
|
143
|
-
const unit = match[2];
|
|
144
|
-
|
|
145
|
-
switch (unit) {
|
|
146
|
-
case 'd': return value;
|
|
147
|
-
case 'h': return value / 24;
|
|
148
|
-
case 'm': return value * 30;
|
|
149
|
-
default: return 7;
|
|
150
|
-
}
|
|
151
|
-
}
|
|
152
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* 📊 Analytics Tool
|
|
3
|
+
* Satış, stok ve performans raporları
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
export const analyticsTool = {
|
|
7
|
+
name: 'analytics',
|
|
8
|
+
|
|
9
|
+
async execute(params, context) {
|
|
10
|
+
const { api, memory } = context;
|
|
11
|
+
const { reportType, platform = 'all', period = '7d' } = params;
|
|
12
|
+
|
|
13
|
+
switch (reportType) {
|
|
14
|
+
case 'sales':
|
|
15
|
+
return await this._salesReport(platform, period, context);
|
|
16
|
+
case 'stock':
|
|
17
|
+
return await this._stockReport(platform, context);
|
|
18
|
+
case 'profit':
|
|
19
|
+
return await this._profitReport(platform, period, context);
|
|
20
|
+
case 'competitors':
|
|
21
|
+
return await this._competitorReport(platform, context);
|
|
22
|
+
case 'trends':
|
|
23
|
+
return await this._trendsReport(context);
|
|
24
|
+
default:
|
|
25
|
+
return { success: false, error: 'Geçersiz rapor türü' };
|
|
26
|
+
}
|
|
27
|
+
},
|
|
28
|
+
|
|
29
|
+
async getSalesReport(period, context) {
|
|
30
|
+
// TODO: Gerçek verilerle
|
|
31
|
+
const periodDays = this._parsePeriod(period);
|
|
32
|
+
|
|
33
|
+
return {
|
|
34
|
+
period,
|
|
35
|
+
revenue: 125750.90,
|
|
36
|
+
orders: 342,
|
|
37
|
+
avgBasket: 367.69,
|
|
38
|
+
topProduct: 'iPhone 15 Pro Kılıf - Siyah',
|
|
39
|
+
growth: '+12%',
|
|
40
|
+
platforms: {
|
|
41
|
+
trendyol: { revenue: 75000, orders: 205 },
|
|
42
|
+
hepsiburada: { revenue: 35000, orders: 95 },
|
|
43
|
+
n11: { revenue: 15750.90, orders: 42 }
|
|
44
|
+
}
|
|
45
|
+
};
|
|
46
|
+
},
|
|
47
|
+
|
|
48
|
+
async _salesReport(platform, period, context) {
|
|
49
|
+
const data = await this.getSalesReport(period, context);
|
|
50
|
+
|
|
51
|
+
return {
|
|
52
|
+
success: true,
|
|
53
|
+
report: data,
|
|
54
|
+
insights: [
|
|
55
|
+
`📈 Geçen ${period}'e göre satışlar %12 arttı.`,
|
|
56
|
+
`🏆 En çok satan ürün: ${data.topProduct}`,
|
|
57
|
+
`💰 Ortalama sepet tutarı: ${data.avgBasket.toFixed(2)} ₺`
|
|
58
|
+
]
|
|
59
|
+
};
|
|
60
|
+
},
|
|
61
|
+
|
|
62
|
+
async _stockReport(platform, context) {
|
|
63
|
+
return {
|
|
64
|
+
success: true,
|
|
65
|
+
report: {
|
|
66
|
+
totalProducts: 1532,
|
|
67
|
+
totalStock: 45680,
|
|
68
|
+
criticalStock: 45,
|
|
69
|
+
outOfStock: 12,
|
|
70
|
+
overstock: 23
|
|
71
|
+
},
|
|
72
|
+
alerts: [
|
|
73
|
+
'⚠️ 45 ürün kritik stok seviyesinde (<5 adet)',
|
|
74
|
+
'❌ 12 ürün stok dışı',
|
|
75
|
+
'📦 23 ürün fazla stoklu (>100 adet, 90 gündür satış yok)'
|
|
76
|
+
],
|
|
77
|
+
actionRequired: [
|
|
78
|
+
{ sku: 'SKU-001', name: 'iPhone Kılıf', stock: 2, action: 'Sipariş ver' },
|
|
79
|
+
{ sku: 'SKU-002', name: 'Samsung Kılıf', stock: 0, action: 'Acil tedarik' }
|
|
80
|
+
]
|
|
81
|
+
};
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
async _profitReport(platform, period, context) {
|
|
85
|
+
return {
|
|
86
|
+
success: true,
|
|
87
|
+
report: {
|
|
88
|
+
revenue: 125750.90,
|
|
89
|
+
costs: 78500.00,
|
|
90
|
+
grossProfit: 47250.90,
|
|
91
|
+
profitMargin: '37.6%',
|
|
92
|
+
topProfitProducts: [
|
|
93
|
+
{ name: 'Premium Kılıf', profit: 8500, margin: '45%' },
|
|
94
|
+
{ name: 'Wireless Şarj', profit: 6200, margin: '42%' }
|
|
95
|
+
],
|
|
96
|
+
lowMarginProducts: [
|
|
97
|
+
{ name: 'Basic Kılıf', margin: '12%', recommendation: 'Fiyat artır' }
|
|
98
|
+
]
|
|
99
|
+
}
|
|
100
|
+
};
|
|
101
|
+
},
|
|
102
|
+
|
|
103
|
+
async _competitorReport(platform, context) {
|
|
104
|
+
return {
|
|
105
|
+
success: true,
|
|
106
|
+
report: {
|
|
107
|
+
tracked: 150,
|
|
108
|
+
priceAdvantage: 45,
|
|
109
|
+
priceDisadvantage: 32,
|
|
110
|
+
priceParity: 73
|
|
111
|
+
},
|
|
112
|
+
opportunities: [
|
|
113
|
+
{ product: 'iPhone 15 Kılıf', yourPrice: 199, avgCompetitor: 229, action: 'Fiyat artırabilirsin' },
|
|
114
|
+
{ product: 'Samsung Kılıf', yourPrice: 149, avgCompetitor: 129, action: 'Rakipler daha ucuz' }
|
|
115
|
+
]
|
|
116
|
+
};
|
|
117
|
+
},
|
|
118
|
+
|
|
119
|
+
async _trendsReport(context) {
|
|
120
|
+
return {
|
|
121
|
+
success: true,
|
|
122
|
+
report: {
|
|
123
|
+
rising: [
|
|
124
|
+
{ term: 'MagSafe şarj', growth: '+420%', volume: 12500 },
|
|
125
|
+
{ term: 'iPhone 15 kılıf', growth: '+180%', volume: 45000 }
|
|
126
|
+
],
|
|
127
|
+
falling: [
|
|
128
|
+
{ term: 'iPhone 12 kılıf', decline: '-35%' }
|
|
129
|
+
]
|
|
130
|
+
},
|
|
131
|
+
recommendations: [
|
|
132
|
+
'🔥 MagSafe ürünleri trend! Envantere ekle.',
|
|
133
|
+
'📉 iPhone 12 aksesuarları düşüşte, stoğu eritmeye odaklan.'
|
|
134
|
+
]
|
|
135
|
+
};
|
|
136
|
+
},
|
|
137
|
+
|
|
138
|
+
_parsePeriod(period) {
|
|
139
|
+
const match = period.match(/(\d+)([dhm])/);
|
|
140
|
+
if (!match) return 7;
|
|
141
|
+
|
|
142
|
+
const value = parseInt(match[1]);
|
|
143
|
+
const unit = match[2];
|
|
144
|
+
|
|
145
|
+
switch (unit) {
|
|
146
|
+
case 'd': return value;
|
|
147
|
+
case 'h': return value / 24;
|
|
148
|
+
case 'm': return value * 30;
|
|
149
|
+
default: return 7;
|
|
150
|
+
}
|
|
151
|
+
}
|
|
152
|
+
};
|