vantuz 3.4.2 → 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 -37
- 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 -5
- package/platforms/pttavm.js +14 -14
- package/plugins/vantuz/index.js +528 -528
- package/plugins/vantuz/memory/hippocampus.js +465 -465
- 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,257 +1,257 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 👁️ Vision AI Tool
|
|
3
|
-
* Fotoğraftan ürün bilgisi çıkarma ve otomatik listeleme
|
|
4
|
-
*/
|
|
5
|
-
|
|
6
|
-
import axios from 'axios';
|
|
7
|
-
import fs from 'fs';
|
|
8
|
-
import path from 'path';
|
|
9
|
-
|
|
10
|
-
export const visionTool = {
|
|
11
|
-
name: 'vision',
|
|
12
|
-
|
|
13
|
-
async execute(params, context) {
|
|
14
|
-
const { api, memory, license } = context;
|
|
15
|
-
const { imageUrl, targetPlatforms = ['trendyol'], autoPublish = false } = params;
|
|
16
|
-
|
|
17
|
-
// Lisans kontrolü
|
|
18
|
-
if (!license.hasFeature('vision')) {
|
|
19
|
-
return { success: false, error: 'Vision AI için lisans gerekli.' };
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
// AI Config kontrolü
|
|
23
|
-
const aiConfig = api.config.get('models.openai') || api.config.get('models.anthropic');
|
|
24
|
-
if (!aiConfig?.apiKey) {
|
|
25
|
-
return { success: false, error: 'AI API anahtarı yapılandırılmamış.' };
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
try {
|
|
29
|
-
// Görsel analizi
|
|
30
|
-
const analysis = await this._analyzeImage(imageUrl, aiConfig);
|
|
31
|
-
|
|
32
|
-
// Kategori eşleştirme (her platform için)
|
|
33
|
-
const categoryMappings = await this._mapCategories(analysis, targetPlatforms);
|
|
34
|
-
|
|
35
|
-
// SEO optimizasyonu
|
|
36
|
-
const seoContent = this._generateSeoContent(analysis);
|
|
37
|
-
|
|
38
|
-
// Hafızaya kaydet
|
|
39
|
-
await memory.remember('product', {
|
|
40
|
-
type: 'vision_analysis',
|
|
41
|
-
analysis,
|
|
42
|
-
seoContent,
|
|
43
|
-
categoryMappings
|
|
44
|
-
}, {
|
|
45
|
-
imageUrl,
|
|
46
|
-
platforms: targetPlatforms
|
|
47
|
-
});
|
|
48
|
-
|
|
49
|
-
const result = {
|
|
50
|
-
success: true,
|
|
51
|
-
analysis: {
|
|
52
|
-
detected: analysis.detected,
|
|
53
|
-
confidence: analysis.confidence,
|
|
54
|
-
attributes: analysis.attributes
|
|
55
|
-
},
|
|
56
|
-
listing: {
|
|
57
|
-
title: seoContent.title,
|
|
58
|
-
description: seoContent.description,
|
|
59
|
-
keywords: seoContent.keywords,
|
|
60
|
-
suggestedPrice: analysis.suggestedPrice
|
|
61
|
-
},
|
|
62
|
-
categories: categoryMappings,
|
|
63
|
-
published: []
|
|
64
|
-
};
|
|
65
|
-
|
|
66
|
-
// Otomatik yayınla
|
|
67
|
-
if (autoPublish) {
|
|
68
|
-
for (const platform of targetPlatforms) {
|
|
69
|
-
try {
|
|
70
|
-
const publishResult = await this._publishToPlatform(platform, {
|
|
71
|
-
...result.listing,
|
|
72
|
-
category: categoryMappings[platform],
|
|
73
|
-
images: [imageUrl]
|
|
74
|
-
}, api);
|
|
75
|
-
|
|
76
|
-
result.published.push({
|
|
77
|
-
platform,
|
|
78
|
-
success: publishResult.success,
|
|
79
|
-
productId: publishResult.productId
|
|
80
|
-
});
|
|
81
|
-
} catch (err) {
|
|
82
|
-
result.published.push({
|
|
83
|
-
platform,
|
|
84
|
-
success: false,
|
|
85
|
-
error: err.message
|
|
86
|
-
});
|
|
87
|
-
}
|
|
88
|
-
}
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
return result;
|
|
92
|
-
|
|
93
|
-
} catch (error) {
|
|
94
|
-
api.logger.error('Vision AI hatası:', error);
|
|
95
|
-
return { success: false, error: error.message };
|
|
96
|
-
}
|
|
97
|
-
},
|
|
98
|
-
|
|
99
|
-
async _analyzeImage(imageUrl, aiConfig) {
|
|
100
|
-
// Görsel base64'e çevir (eğer URL ise)
|
|
101
|
-
let imageData = imageUrl;
|
|
102
|
-
|
|
103
|
-
if (imageUrl.startsWith('http')) {
|
|
104
|
-
const response = await axios.get(imageUrl, { responseType: 'arraybuffer' });
|
|
105
|
-
imageData = `data:image/jpeg;base64,${Buffer.from(response.data).toString('base64')}`;
|
|
106
|
-
} else if (fs.existsSync(imageUrl)) {
|
|
107
|
-
const buffer = fs.readFileSync(imageUrl);
|
|
108
|
-
imageData = `data:image/jpeg;base64,${buffer.toString('base64')}`;
|
|
109
|
-
}
|
|
110
|
-
|
|
111
|
-
// OpenAI Vision API
|
|
112
|
-
const response = await axios.post(`${aiConfig.baseUrl || 'https://api.openai.com/v1'}/chat/completions`, {
|
|
113
|
-
model: 'gpt-4o',
|
|
114
|
-
messages: [
|
|
115
|
-
{
|
|
116
|
-
role: 'user',
|
|
117
|
-
content: [
|
|
118
|
-
{
|
|
119
|
-
type: 'text',
|
|
120
|
-
text: `Bu ürün fotoğrafını analiz et ve şu bilgileri JSON formatında ver:
|
|
121
|
-
{
|
|
122
|
-
"detected": "Ürün tipi (örn: Kadın Tişört)",
|
|
123
|
-
"confidence": 0.95,
|
|
124
|
-
"attributes": {
|
|
125
|
-
"color": "Renk",
|
|
126
|
-
"material": "Malzeme",
|
|
127
|
-
"style": "Stil",
|
|
128
|
-
"size_type": "Beden tipi (standart/plus size vb)",
|
|
129
|
-
"pattern": "Desen",
|
|
130
|
-
"brand_indicators": "Marka işaretleri varsa"
|
|
131
|
-
},
|
|
132
|
-
"suggestedPrice": {
|
|
133
|
-
"min": 100,
|
|
134
|
-
"max": 200,
|
|
135
|
-
"optimal": 149
|
|
136
|
-
},
|
|
137
|
-
"seo_keywords": ["anahtar kelime 1", "anahtar kelime 2"],
|
|
138
|
-
"target_audience": "Hedef kitle"
|
|
139
|
-
}`
|
|
140
|
-
},
|
|
141
|
-
{
|
|
142
|
-
type: 'image_url',
|
|
143
|
-
image_url: { url: imageData }
|
|
144
|
-
}
|
|
145
|
-
]
|
|
146
|
-
}
|
|
147
|
-
],
|
|
148
|
-
max_tokens: 1000
|
|
149
|
-
}, {
|
|
150
|
-
headers: {
|
|
151
|
-
'Authorization': `Bearer ${aiConfig.apiKey}`,
|
|
152
|
-
'Content-Type': 'application/json'
|
|
153
|
-
}
|
|
154
|
-
});
|
|
155
|
-
|
|
156
|
-
const content = response.data.choices[0].message.content;
|
|
157
|
-
// JSON bloğunu çıkar
|
|
158
|
-
const jsonMatch = content.match(/\{[\s\S]*\}/);
|
|
159
|
-
if (jsonMatch) {
|
|
160
|
-
return JSON.parse(jsonMatch[0]);
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
throw new Error('AI yanıtı parse edilemedi');
|
|
164
|
-
},
|
|
165
|
-
|
|
166
|
-
async _mapCategories(analysis, platforms) {
|
|
167
|
-
const mappings = {};
|
|
168
|
-
|
|
169
|
-
// Platform-spesifik kategori eşleştirme
|
|
170
|
-
// Gerçek implementasyonda platform kategori API'leri kullanılır
|
|
171
|
-
const categoryMap = {
|
|
172
|
-
trendyol: {
|
|
173
|
-
'Kadın Tişört': 'Kadın > Giyim > Tişört > V Yaka',
|
|
174
|
-
'Erkek Gömlek': 'Erkek > Giyim > Gömlek > Uzun Kollu',
|
|
175
|
-
'Telefon Kılıfı': 'Elektronik > Telefon Aksesuarları > Kılıflar'
|
|
176
|
-
},
|
|
177
|
-
hepsiburada: {
|
|
178
|
-
'Kadın Tişört': 'Moda > Kadın Giyim > Üst Giyim > Tişört',
|
|
179
|
-
'Erkek Gömlek': 'Moda > Erkek Giyim > Gömlek',
|
|
180
|
-
'Telefon Kılıfı': 'Telefon & Aksesuar > Telefon Kılıfları'
|
|
181
|
-
},
|
|
182
|
-
amazon_de: {
|
|
183
|
-
'Kadın Tişört': 'Bekleidung > Damen > Oberteile > T-Shirts',
|
|
184
|
-
'Erkek Gömlek': 'Bekleidung > Herren > Hemden',
|
|
185
|
-
'Telefon Kılıfı': 'Elektronik > Handys > Hüllen'
|
|
186
|
-
},
|
|
187
|
-
n11: {
|
|
188
|
-
'Kadın Tişört': 'Giyim & Aksesuar > Kadın Giyim > Tişört',
|
|
189
|
-
'Erkek Gömlek': 'Giyim & Aksesuar > Erkek Giyim > Gömlek',
|
|
190
|
-
'Telefon Kılıfı': 'Elektronik > Telefon Aksesuarları > Kılıf'
|
|
191
|
-
}
|
|
192
|
-
};
|
|
193
|
-
|
|
194
|
-
for (const platform of platforms) {
|
|
195
|
-
const platformMap = categoryMap[platform] || {};
|
|
196
|
-
mappings[platform] = platformMap[analysis.detected] || 'Genel > Diğer';
|
|
197
|
-
}
|
|
198
|
-
|
|
199
|
-
return mappings;
|
|
200
|
-
},
|
|
201
|
-
|
|
202
|
-
_generateSeoContent(analysis) {
|
|
203
|
-
const { detected, attributes, seo_keywords = [] } = analysis;
|
|
204
|
-
|
|
205
|
-
// SEO uyumlu başlık oluştur
|
|
206
|
-
const titleParts = [];
|
|
207
|
-
if (attributes.material) titleParts.push(attributes.material);
|
|
208
|
-
if (attributes.color) titleParts.push(attributes.color);
|
|
209
|
-
if (detected) titleParts.push(detected);
|
|
210
|
-
if (attributes.style) titleParts.push(attributes.style);
|
|
211
|
-
|
|
212
|
-
const title = titleParts.join(' ').slice(0, 100);
|
|
213
|
-
|
|
214
|
-
// Açıklama oluştur
|
|
215
|
-
const description = `
|
|
216
|
-
${title}
|
|
217
|
-
|
|
218
|
-
✨ Ürün Özellikleri:
|
|
219
|
-
${attributes.material ? `• Malzeme: ${attributes.material}` : ''}
|
|
220
|
-
${attributes.color ? `• Renk: ${attributes.color}` : ''}
|
|
221
|
-
${attributes.style ? `• Stil: ${attributes.style}` : ''}
|
|
222
|
-
${attributes.pattern ? `• Desen: ${attributes.pattern}` : ''}
|
|
223
|
-
|
|
224
|
-
🛒 Neden Bu Ürün?
|
|
225
|
-
• Yüksek kaliteli malzeme
|
|
226
|
-
• Şık ve modern tasarım
|
|
227
|
-
• Rahat kullanım
|
|
228
|
-
• Hızlı kargo
|
|
229
|
-
|
|
230
|
-
📦 Kargo Bilgisi:
|
|
231
|
-
Siparişiniz aynı gün kargoya verilir.
|
|
232
|
-
|
|
233
|
-
⭐ Müşteri Memnuniyeti:
|
|
234
|
-
Tüm ürünlerimiz kalite kontrol sürecinden geçmektedir.
|
|
235
|
-
|
|
236
|
-
#${seo_keywords.join(' #')}
|
|
237
|
-
`.trim();
|
|
238
|
-
|
|
239
|
-
return {
|
|
240
|
-
title,
|
|
241
|
-
description,
|
|
242
|
-
keywords: seo_keywords,
|
|
243
|
-
shortDescription: titleParts.join(' ')
|
|
244
|
-
};
|
|
245
|
-
},
|
|
246
|
-
|
|
247
|
-
async _publishToPlatform(platform, listingData, api) {
|
|
248
|
-
// TODO: Platform API'lerine ürün yayınlama
|
|
249
|
-
api.logger.info(`📤 ${platform}'a yayınlanıyor: ${listingData.title}`);
|
|
250
|
-
|
|
251
|
-
// Mock response
|
|
252
|
-
return {
|
|
253
|
-
success: true,
|
|
254
|
-
productId: `${platform}_${Date.now()}`
|
|
255
|
-
};
|
|
256
|
-
}
|
|
257
|
-
};
|
|
1
|
+
/**
|
|
2
|
+
* 👁️ Vision AI Tool
|
|
3
|
+
* Fotoğraftan ürün bilgisi çıkarma ve otomatik listeleme
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
|
+
import axios from 'axios';
|
|
7
|
+
import fs from 'fs';
|
|
8
|
+
import path from 'path';
|
|
9
|
+
|
|
10
|
+
export const visionTool = {
|
|
11
|
+
name: 'vision',
|
|
12
|
+
|
|
13
|
+
async execute(params, context) {
|
|
14
|
+
const { api, memory, license } = context;
|
|
15
|
+
const { imageUrl, targetPlatforms = ['trendyol'], autoPublish = false } = params;
|
|
16
|
+
|
|
17
|
+
// Lisans kontrolü
|
|
18
|
+
if (!license.hasFeature('vision')) {
|
|
19
|
+
return { success: false, error: 'Vision AI için lisans gerekli.' };
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
// AI Config kontrolü
|
|
23
|
+
const aiConfig = api.config.get('models.openai') || api.config.get('models.anthropic');
|
|
24
|
+
if (!aiConfig?.apiKey) {
|
|
25
|
+
return { success: false, error: 'AI API anahtarı yapılandırılmamış.' };
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
try {
|
|
29
|
+
// Görsel analizi
|
|
30
|
+
const analysis = await this._analyzeImage(imageUrl, aiConfig);
|
|
31
|
+
|
|
32
|
+
// Kategori eşleştirme (her platform için)
|
|
33
|
+
const categoryMappings = await this._mapCategories(analysis, targetPlatforms);
|
|
34
|
+
|
|
35
|
+
// SEO optimizasyonu
|
|
36
|
+
const seoContent = this._generateSeoContent(analysis);
|
|
37
|
+
|
|
38
|
+
// Hafızaya kaydet
|
|
39
|
+
await memory.remember('product', {
|
|
40
|
+
type: 'vision_analysis',
|
|
41
|
+
analysis,
|
|
42
|
+
seoContent,
|
|
43
|
+
categoryMappings
|
|
44
|
+
}, {
|
|
45
|
+
imageUrl,
|
|
46
|
+
platforms: targetPlatforms
|
|
47
|
+
});
|
|
48
|
+
|
|
49
|
+
const result = {
|
|
50
|
+
success: true,
|
|
51
|
+
analysis: {
|
|
52
|
+
detected: analysis.detected,
|
|
53
|
+
confidence: analysis.confidence,
|
|
54
|
+
attributes: analysis.attributes
|
|
55
|
+
},
|
|
56
|
+
listing: {
|
|
57
|
+
title: seoContent.title,
|
|
58
|
+
description: seoContent.description,
|
|
59
|
+
keywords: seoContent.keywords,
|
|
60
|
+
suggestedPrice: analysis.suggestedPrice
|
|
61
|
+
},
|
|
62
|
+
categories: categoryMappings,
|
|
63
|
+
published: []
|
|
64
|
+
};
|
|
65
|
+
|
|
66
|
+
// Otomatik yayınla
|
|
67
|
+
if (autoPublish) {
|
|
68
|
+
for (const platform of targetPlatforms) {
|
|
69
|
+
try {
|
|
70
|
+
const publishResult = await this._publishToPlatform(platform, {
|
|
71
|
+
...result.listing,
|
|
72
|
+
category: categoryMappings[platform],
|
|
73
|
+
images: [imageUrl]
|
|
74
|
+
}, api);
|
|
75
|
+
|
|
76
|
+
result.published.push({
|
|
77
|
+
platform,
|
|
78
|
+
success: publishResult.success,
|
|
79
|
+
productId: publishResult.productId
|
|
80
|
+
});
|
|
81
|
+
} catch (err) {
|
|
82
|
+
result.published.push({
|
|
83
|
+
platform,
|
|
84
|
+
success: false,
|
|
85
|
+
error: err.message
|
|
86
|
+
});
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
return result;
|
|
92
|
+
|
|
93
|
+
} catch (error) {
|
|
94
|
+
api.logger.error('Vision AI hatası:', error);
|
|
95
|
+
return { success: false, error: error.message };
|
|
96
|
+
}
|
|
97
|
+
},
|
|
98
|
+
|
|
99
|
+
async _analyzeImage(imageUrl, aiConfig) {
|
|
100
|
+
// Görsel base64'e çevir (eğer URL ise)
|
|
101
|
+
let imageData = imageUrl;
|
|
102
|
+
|
|
103
|
+
if (imageUrl.startsWith('http')) {
|
|
104
|
+
const response = await axios.get(imageUrl, { responseType: 'arraybuffer' });
|
|
105
|
+
imageData = `data:image/jpeg;base64,${Buffer.from(response.data).toString('base64')}`;
|
|
106
|
+
} else if (fs.existsSync(imageUrl)) {
|
|
107
|
+
const buffer = fs.readFileSync(imageUrl);
|
|
108
|
+
imageData = `data:image/jpeg;base64,${buffer.toString('base64')}`;
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
// OpenAI Vision API
|
|
112
|
+
const response = await axios.post(`${aiConfig.baseUrl || 'https://api.openai.com/v1'}/chat/completions`, {
|
|
113
|
+
model: 'gpt-4o',
|
|
114
|
+
messages: [
|
|
115
|
+
{
|
|
116
|
+
role: 'user',
|
|
117
|
+
content: [
|
|
118
|
+
{
|
|
119
|
+
type: 'text',
|
|
120
|
+
text: `Bu ürün fotoğrafını analiz et ve şu bilgileri JSON formatında ver:
|
|
121
|
+
{
|
|
122
|
+
"detected": "Ürün tipi (örn: Kadın Tişört)",
|
|
123
|
+
"confidence": 0.95,
|
|
124
|
+
"attributes": {
|
|
125
|
+
"color": "Renk",
|
|
126
|
+
"material": "Malzeme",
|
|
127
|
+
"style": "Stil",
|
|
128
|
+
"size_type": "Beden tipi (standart/plus size vb)",
|
|
129
|
+
"pattern": "Desen",
|
|
130
|
+
"brand_indicators": "Marka işaretleri varsa"
|
|
131
|
+
},
|
|
132
|
+
"suggestedPrice": {
|
|
133
|
+
"min": 100,
|
|
134
|
+
"max": 200,
|
|
135
|
+
"optimal": 149
|
|
136
|
+
},
|
|
137
|
+
"seo_keywords": ["anahtar kelime 1", "anahtar kelime 2"],
|
|
138
|
+
"target_audience": "Hedef kitle"
|
|
139
|
+
}`
|
|
140
|
+
},
|
|
141
|
+
{
|
|
142
|
+
type: 'image_url',
|
|
143
|
+
image_url: { url: imageData }
|
|
144
|
+
}
|
|
145
|
+
]
|
|
146
|
+
}
|
|
147
|
+
],
|
|
148
|
+
max_tokens: 1000
|
|
149
|
+
}, {
|
|
150
|
+
headers: {
|
|
151
|
+
'Authorization': `Bearer ${aiConfig.apiKey}`,
|
|
152
|
+
'Content-Type': 'application/json'
|
|
153
|
+
}
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
const content = response.data.choices[0].message.content;
|
|
157
|
+
// JSON bloğunu çıkar
|
|
158
|
+
const jsonMatch = content.match(/\{[\s\S]*\}/);
|
|
159
|
+
if (jsonMatch) {
|
|
160
|
+
return JSON.parse(jsonMatch[0]);
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
throw new Error('AI yanıtı parse edilemedi');
|
|
164
|
+
},
|
|
165
|
+
|
|
166
|
+
async _mapCategories(analysis, platforms) {
|
|
167
|
+
const mappings = {};
|
|
168
|
+
|
|
169
|
+
// Platform-spesifik kategori eşleştirme
|
|
170
|
+
// Gerçek implementasyonda platform kategori API'leri kullanılır
|
|
171
|
+
const categoryMap = {
|
|
172
|
+
trendyol: {
|
|
173
|
+
'Kadın Tişört': 'Kadın > Giyim > Tişört > V Yaka',
|
|
174
|
+
'Erkek Gömlek': 'Erkek > Giyim > Gömlek > Uzun Kollu',
|
|
175
|
+
'Telefon Kılıfı': 'Elektronik > Telefon Aksesuarları > Kılıflar'
|
|
176
|
+
},
|
|
177
|
+
hepsiburada: {
|
|
178
|
+
'Kadın Tişört': 'Moda > Kadın Giyim > Üst Giyim > Tişört',
|
|
179
|
+
'Erkek Gömlek': 'Moda > Erkek Giyim > Gömlek',
|
|
180
|
+
'Telefon Kılıfı': 'Telefon & Aksesuar > Telefon Kılıfları'
|
|
181
|
+
},
|
|
182
|
+
amazon_de: {
|
|
183
|
+
'Kadın Tişört': 'Bekleidung > Damen > Oberteile > T-Shirts',
|
|
184
|
+
'Erkek Gömlek': 'Bekleidung > Herren > Hemden',
|
|
185
|
+
'Telefon Kılıfı': 'Elektronik > Handys > Hüllen'
|
|
186
|
+
},
|
|
187
|
+
n11: {
|
|
188
|
+
'Kadın Tişört': 'Giyim & Aksesuar > Kadın Giyim > Tişört',
|
|
189
|
+
'Erkek Gömlek': 'Giyim & Aksesuar > Erkek Giyim > Gömlek',
|
|
190
|
+
'Telefon Kılıfı': 'Elektronik > Telefon Aksesuarları > Kılıf'
|
|
191
|
+
}
|
|
192
|
+
};
|
|
193
|
+
|
|
194
|
+
for (const platform of platforms) {
|
|
195
|
+
const platformMap = categoryMap[platform] || {};
|
|
196
|
+
mappings[platform] = platformMap[analysis.detected] || 'Genel > Diğer';
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
return mappings;
|
|
200
|
+
},
|
|
201
|
+
|
|
202
|
+
_generateSeoContent(analysis) {
|
|
203
|
+
const { detected, attributes, seo_keywords = [] } = analysis;
|
|
204
|
+
|
|
205
|
+
// SEO uyumlu başlık oluştur
|
|
206
|
+
const titleParts = [];
|
|
207
|
+
if (attributes.material) titleParts.push(attributes.material);
|
|
208
|
+
if (attributes.color) titleParts.push(attributes.color);
|
|
209
|
+
if (detected) titleParts.push(detected);
|
|
210
|
+
if (attributes.style) titleParts.push(attributes.style);
|
|
211
|
+
|
|
212
|
+
const title = titleParts.join(' ').slice(0, 100);
|
|
213
|
+
|
|
214
|
+
// Açıklama oluştur
|
|
215
|
+
const description = `
|
|
216
|
+
${title}
|
|
217
|
+
|
|
218
|
+
✨ Ürün Özellikleri:
|
|
219
|
+
${attributes.material ? `• Malzeme: ${attributes.material}` : ''}
|
|
220
|
+
${attributes.color ? `• Renk: ${attributes.color}` : ''}
|
|
221
|
+
${attributes.style ? `• Stil: ${attributes.style}` : ''}
|
|
222
|
+
${attributes.pattern ? `• Desen: ${attributes.pattern}` : ''}
|
|
223
|
+
|
|
224
|
+
🛒 Neden Bu Ürün?
|
|
225
|
+
• Yüksek kaliteli malzeme
|
|
226
|
+
• Şık ve modern tasarım
|
|
227
|
+
• Rahat kullanım
|
|
228
|
+
• Hızlı kargo
|
|
229
|
+
|
|
230
|
+
📦 Kargo Bilgisi:
|
|
231
|
+
Siparişiniz aynı gün kargoya verilir.
|
|
232
|
+
|
|
233
|
+
⭐ Müşteri Memnuniyeti:
|
|
234
|
+
Tüm ürünlerimiz kalite kontrol sürecinden geçmektedir.
|
|
235
|
+
|
|
236
|
+
#${seo_keywords.join(' #')}
|
|
237
|
+
`.trim();
|
|
238
|
+
|
|
239
|
+
return {
|
|
240
|
+
title,
|
|
241
|
+
description,
|
|
242
|
+
keywords: seo_keywords,
|
|
243
|
+
shortDescription: titleParts.join(' ')
|
|
244
|
+
};
|
|
245
|
+
},
|
|
246
|
+
|
|
247
|
+
async _publishToPlatform(platform, listingData, api) {
|
|
248
|
+
// TODO: Platform API'lerine ürün yayınlama
|
|
249
|
+
api.logger.info(`📤 ${platform}'a yayınlanıyor: ${listingData.title}`);
|
|
250
|
+
|
|
251
|
+
// Mock response
|
|
252
|
+
return {
|
|
253
|
+
success: true,
|
|
254
|
+
productId: `${platform}_${Date.now()}`
|
|
255
|
+
};
|
|
256
|
+
}
|
|
257
|
+
};
|
package/private.pem
ADDED
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
-----BEGIN PRIVATE KEY-----
|
|
2
|
+
MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCc5oQUH7ezai4a
|
|
3
|
+
dt8aVsRc7nn9EWOiJ+fZ0w1Mu3j1SXoKwMRLRVoo5Df5WbLDw6NjDLvvdn/C6dfT
|
|
4
|
+
2oIRcMS8ocCHHEFrdFBp8htD/YwjIZOO/GsZ6UM/MHrJK1LAuBKFxe1G8CHr1pek
|
|
5
|
+
WNcItpay82r7u9yc11d5nZzSKlZueqOk+IUoN77Bn/+CTHvTNhdzhaKPIu1NBYLo
|
|
6
|
+
GhuGk4CKzHm7KRPOv4su0xvafVOnESilJFuQtBAPg0yyQf0RvU3HfOeX4+NmihRe
|
|
7
|
+
+v7x4muNCnQ9MNMvfYsejaJpbCQpnfw8Nz+F9K67cq3fW3RIjEDA5twKY7Y62Jnv
|
|
8
|
+
BMrEOjBHAgMBAAECggEAQsj8P3SgxQXVSf5/SL7WJph75HSabFOAJP/pEVhbTE1S
|
|
9
|
+
XXFgHIoQroc2LDU6GooT6f1poaxXBahz7gF8i9/sXj6brOciEZMZB3++i1pJZErO
|
|
10
|
+
fHaFQCpCLYt9OFPwjYfMmpR9Q0zDo5dcROBr55GQ4+spBq4YYcpnuaSVNABBehSe
|
|
11
|
+
/b2spCYdS+BZ3IsPsJyNs488fTM3QXhHyNVSeHAvaCU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