vantuz 3.1.4 → 3.1.6
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
|
@@ -30,7 +30,7 @@ export class TrendyolAPI {
|
|
|
30
30
|
return {
|
|
31
31
|
'Authorization': `Basic ${this.auth}`,
|
|
32
32
|
'Content-Type': 'application/json',
|
|
33
|
-
'User-Agent':
|
|
33
|
+
'User-Agent': 'Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/120.0.0.0 Safari/537.36'
|
|
34
34
|
};
|
|
35
35
|
}
|
|
36
36
|
|
|
@@ -43,6 +43,12 @@ export class TrendyolAPI {
|
|
|
43
43
|
data,
|
|
44
44
|
params
|
|
45
45
|
});
|
|
46
|
+
return { success: true, data: response.data };
|
|
47
|
+
} catch (error) {
|
|
48
|
+
const errorMsg = error.response?.data?.errors?.[0]?.message || error.message;
|
|
49
|
+
const statusCode = error.response?.status;
|
|
50
|
+
|
|
51
|
+
console.error(`[Trendyol] API Hatası (${statusCode}): ${errorMsg}`);
|
|
46
52
|
if (error.response?.data) {
|
|
47
53
|
try {
|
|
48
54
|
console.error('[Trendyol] Hata Detayı:', JSON.stringify(error.response.data));
|
|
@@ -55,7 +61,7 @@ export class TrendyolAPI {
|
|
|
55
61
|
status: statusCode
|
|
56
62
|
};
|
|
57
63
|
}
|
|
58
|
-
}
|
|
64
|
+
}
|
|
59
65
|
|
|
60
66
|
// ═══════════════════════════════════════════════════════════════════════════
|
|
61
67
|
// ÜRÜN İŞLEMLERİ
|