vantuz 3.1.2 → 3.1.4

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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "vantuz",
3
- "version": "3.1.2",
3
+ "version": "3.1.4",
4
4
  "description": "Yapay Zeka Destekli E-Ticaret Yönetim Platformu - 7 Pazaryeri + WhatsApp/Telegram",
5
5
  "type": "module",
6
6
  "main": "cli.js",
@@ -10,6 +10,7 @@
10
10
  */
11
11
 
12
12
  import axios from 'axios';
13
+ import { log } from '../../../core/ai-provider.js';
13
14
 
14
15
  const BASE_URL = 'https://api.trendyol.com/sapigw';
15
16
  const STAGE_URL = 'https://stageapi.trendyol.com/stagesapigw'; // Test ortamı
@@ -42,15 +43,19 @@ export class TrendyolAPI {
42
43
  data,
43
44
  params
44
45
  });
45
- return { success: true, data: response.data };
46
- } catch (error) {
46
+ if (error.response?.data) {
47
+ try {
48
+ console.error('[Trendyol] Hata Detayı:', JSON.stringify(error.response.data));
49
+ } catch (e) { }
50
+ }
51
+
47
52
  return {
48
53
  success: false,
49
- error: error.response?.data?.errors || error.message,
50
- status: error.response?.status
54
+ error: errorMsg,
55
+ status: statusCode
51
56
  };
52
57
  }
53
- }
58
+ }
54
59
 
55
60
  // ═══════════════════════════════════════════════════════════════════════════
56
61
  // ÜRÜN İŞLEMLERİ
@@ -303,5 +308,6 @@ export const trendyolApi = {
303
308
  async updatePrice(barcode, price) { return instance?.updatePrice(barcode, price); },
304
309
  async updateStock(barcode, qty) { return instance?.updateStock(barcode, qty); },
305
310
  async getOrders(params) { return instance?.getOrders(params); },
306
- async getCompetitors(barcode) { return instance?.getCompetitorPrices(barcode); }
311
+ async getCompetitors(barcode) { return instance?.getCompetitorPrices(barcode); },
312
+ async testConnection() { return instance?.testConnection(); }
307
313
  };