vantuz 3.1.7 → 3.1.9
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
|
@@ -12,8 +12,8 @@
|
|
|
12
12
|
import axios from 'axios';
|
|
13
13
|
import { log } from '../../../core/ai-provider.js';
|
|
14
14
|
|
|
15
|
-
const BASE_URL = 'https://api.trendyol.com/
|
|
16
|
-
const STAGE_URL = 'https://stageapi.trendyol.com/
|
|
15
|
+
const BASE_URL = 'https://api.trendyol.com/integration';
|
|
16
|
+
const STAGE_URL = 'https://stageapi.trendyol.com/integration'; // Test ortamı
|
|
17
17
|
|
|
18
18
|
export class TrendyolAPI {
|
|
19
19
|
constructor(config) {
|
|
@@ -30,17 +30,7 @@ export class TrendyolAPI {
|
|
|
30
30
|
return {
|
|
31
31
|
'Authorization': `Basic ${this.auth}`,
|
|
32
32
|
'Content-Type': 'application/json',
|
|
33
|
-
'User-Agent':
|
|
34
|
-
'Accept': 'application/json',
|
|
35
|
-
'Accept-Language': 'tr-TR,tr;q=0.9,en-US;q=0.8,en;q=0.7',
|
|
36
|
-
'Cache-Control': 'no-cache',
|
|
37
|
-
'Pragma': 'no-cache',
|
|
38
|
-
'Sec-Ch-Ua': '"Chromium";v="122", "Not(A:Brand";v="24", "Google Chrome";v="122"',
|
|
39
|
-
'Sec-Ch-Ua-Mobile': '?0',
|
|
40
|
-
'Sec-Ch-Ua-Platform': '"Windows"',
|
|
41
|
-
'Sec-Fetch-Dest': 'empty',
|
|
42
|
-
'Sec-Fetch-Mode': 'cors',
|
|
43
|
-
'Sec-Fetch-Site': 'same-site'
|
|
33
|
+
'User-Agent': `${this.supplierId} - VantuzAI`
|
|
44
34
|
};
|
|
45
35
|
}
|
|
46
36
|
|
|
@@ -79,8 +69,8 @@ export class TrendyolAPI {
|
|
|
79
69
|
|
|
80
70
|
async getProducts(params = {}) {
|
|
81
71
|
const { page = 0, size = 50, barcode, approved, onSale } = params;
|
|
82
|
-
return await this._request('GET', `/
|
|
83
|
-
page, size, barcode, approved, onSale
|
|
72
|
+
return await this._request('GET', `/product/sellers/${this.supplierId}/products`, null, {
|
|
73
|
+
page, size, barcode, approved, onSale, date
|
|
84
74
|
});
|
|
85
75
|
}
|
|
86
76
|
|
|
@@ -151,7 +141,7 @@ export class TrendyolAPI {
|
|
|
151
141
|
orderNumber
|
|
152
142
|
} = params;
|
|
153
143
|
|
|
154
|
-
return await this._request('GET', `/
|
|
144
|
+
return await this._request('GET', `/order/sellers/${this.supplierId}/orders`, null, {
|
|
155
145
|
status, startDate, endDate, page, size, orderNumber, orderByDirection: 'DESC', orderByField: 'PackageLastModifiedDate'
|
|
156
146
|
});
|
|
157
147
|
}
|