vantuz 3.4.2 → 3.5.1
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/.env.example +21 -0
- package/.openclaw/completions/openclaw.bash +227 -0
- package/.openclaw/completions/openclaw.fish +1552 -0
- package/.openclaw/completions/openclaw.ps1 +1966 -0
- package/.openclaw/completions/openclaw.zsh +3571 -0
- package/.openclaw/gateway.cmd +10 -0
- package/.openclaw/identity/device.json +7 -0
- package/.openclaw/openclaw.json +40 -0
- package/.windsurf/workflows/vantuz-dev.md +31 -0
- package/DOCS_TR.md +80 -0
- package/LICENSE +45 -45
- package/README.md +52 -21
- 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/n11docs.md +1680 -0
- package/nodes/warehouse.js +238 -238
- package/onboard.js +1 -1
- package/openclawdocs.md +3 -0
- 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/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
- package/workspace/AGENTS.md +73 -0
- package/workspace/BRAND.md +29 -0
- package/workspace/SOUL.md +72 -0
- package/workspace/team/DECISIONS.md +3 -0
- package/workspace/team/GOALS.md +3 -0
- package/workspace/team/PROJECT_STATUS.md +3 -0
- package/workspace/team/agents/dev/SOUL.md +12 -0
- package/workspace/team/agents/josh/SOUL.md +12 -0
- package/workspace/team/agents/marketing/SOUL.md +12 -0
- package/workspace/team/agents/milo/SOUL.md +12 -0
- package/vantuz-3.3.4.tgz +0 -0
|
@@ -1,33 +1,33 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* 🟣 HEPSİBURADA API Entegrasyonu
|
|
3
|
-
* developer.hepsiburada.com
|
|
4
|
-
*/
|
|
5
|
-
|
|
1
|
+
/**
|
|
2
|
+
* 🟣 HEPSİBURADA API Entegrasyonu
|
|
3
|
+
* developer.hepsiburada.com
|
|
4
|
+
*/
|
|
5
|
+
|
|
6
6
|
import axios from 'axios';
|
|
7
7
|
import { requestWithRetry } from './_request.js';
|
|
8
|
-
|
|
9
|
-
const BASE_URL = 'https://mpop-sit.hepsiburada.com'; // Production: mpop.hepsiburada.com
|
|
10
|
-
const LISTING_URL = 'https://listing-external.hepsiburada.com';
|
|
11
|
-
|
|
12
|
-
export class HepsiburadaAPI {
|
|
13
|
-
constructor(config) {
|
|
14
|
-
this.merchantId = config.merchantId;
|
|
15
|
-
this.username = config.username;
|
|
16
|
-
this.password = config.password;
|
|
17
|
-
|
|
18
|
-
this.auth = Buffer.from(`${this.username}:${this.password}`).toString('base64');
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
_headers() {
|
|
22
|
-
return {
|
|
23
|
-
'Authorization': `Basic ${this.auth}`,
|
|
24
|
-
'Content-Type': 'application/json',
|
|
25
|
-
'Accept': 'application/json'
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
async _request(method, url, data = null, params = null) {
|
|
30
|
-
try {
|
|
8
|
+
|
|
9
|
+
const BASE_URL = 'https://mpop-sit.hepsiburada.com'; // Production: mpop.hepsiburada.com
|
|
10
|
+
const LISTING_URL = 'https://listing-external.hepsiburada.com';
|
|
11
|
+
|
|
12
|
+
export class HepsiburadaAPI {
|
|
13
|
+
constructor(config) {
|
|
14
|
+
this.merchantId = config.merchantId;
|
|
15
|
+
this.username = config.username;
|
|
16
|
+
this.password = config.password;
|
|
17
|
+
|
|
18
|
+
this.auth = Buffer.from(`${this.username}:${this.password}`).toString('base64');
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
_headers() {
|
|
22
|
+
return {
|
|
23
|
+
'Authorization': `Basic ${this.auth}`,
|
|
24
|
+
'Content-Type': 'application/json',
|
|
25
|
+
'Accept': 'application/json'
|
|
26
|
+
};
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
async _request(method, url, data = null, params = null) {
|
|
30
|
+
try {
|
|
31
31
|
const response = await requestWithRetry(axios, {
|
|
32
32
|
method,
|
|
33
33
|
url,
|
|
@@ -40,155 +40,155 @@ export class HepsiburadaAPI {
|
|
|
40
40
|
maxDelayMs: 4000
|
|
41
41
|
});
|
|
42
42
|
return { success: true, data: response.data };
|
|
43
|
-
} catch (error) {
|
|
44
|
-
return {
|
|
45
|
-
success: false,
|
|
46
|
-
error: error.response?.data || error.message
|
|
47
|
-
};
|
|
48
|
-
}
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
// ═══════════════════════════════════════════════════════════════════════════
|
|
52
|
-
// ÜRÜN İŞLEMLERİ
|
|
53
|
-
// ═══════════════════════════════════════════════════════════════════════════
|
|
54
|
-
|
|
55
|
-
async getProducts(params = {}) {
|
|
56
|
-
const { page = 0, size = 100, sku } = params;
|
|
57
|
-
return await this._request('GET',
|
|
58
|
-
`${LISTING_URL}/Listings/merchantid/${this.merchantId}`,
|
|
59
|
-
null, { page, size, merchantSku: sku }
|
|
60
|
-
);
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
async createProduct(product) {
|
|
64
|
-
// product: { merchantSku, hepsiburadaSku, price, availableStock, ... }
|
|
65
|
-
return await this._request('POST',
|
|
66
|
-
`${LISTING_URL}/Listings/merchantid/${this.merchantId}/sku/${product.hepsiburadaSku}`,
|
|
67
|
-
product
|
|
68
|
-
);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
async updatePrice(merchantSku, price) {
|
|
72
|
-
return await this._request('POST',
|
|
73
|
-
`${LISTING_URL}/Listings/merchantid/${this.merchantId}`,
|
|
74
|
-
{
|
|
75
|
-
listings: [{
|
|
76
|
-
merchantSku,
|
|
77
|
-
price,
|
|
78
|
-
currency: 'TRY'
|
|
79
|
-
}]
|
|
80
|
-
}
|
|
81
|
-
);
|
|
82
|
-
}
|
|
83
|
-
|
|
84
|
-
async updateStock(merchantSku, stock) {
|
|
85
|
-
return await this._request('POST',
|
|
86
|
-
`${LISTING_URL}/Listings/merchantid/${this.merchantId}`,
|
|
87
|
-
{
|
|
88
|
-
listings: [{
|
|
89
|
-
merchantSku,
|
|
90
|
-
availableStock: stock
|
|
91
|
-
}]
|
|
92
|
-
}
|
|
93
|
-
);
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
async bulkUpdate(listings) {
|
|
97
|
-
// listings: [{ merchantSku, price?, availableStock? }]
|
|
98
|
-
return await this._request('POST',
|
|
99
|
-
`${LISTING_URL}/Listings/merchantid/${this.merchantId}`,
|
|
100
|
-
{ listings }
|
|
101
|
-
);
|
|
102
|
-
}
|
|
103
|
-
|
|
104
|
-
// ═══════════════════════════════════════════════════════════════════════════
|
|
105
|
-
// SİPARİŞ İŞLEMLERİ
|
|
106
|
-
// ═══════════════════════════════════════════════════════════════════════════
|
|
107
|
-
|
|
108
|
-
async getOrders(params = {}) {
|
|
109
|
-
const {
|
|
110
|
-
status, // Open, Shipped, Delivered, Cancelled
|
|
111
|
-
startDate,
|
|
112
|
-
endDate,
|
|
113
|
-
page = 0,
|
|
114
|
-
size = 50
|
|
115
|
-
} = params;
|
|
116
|
-
|
|
117
|
-
return await this._request('GET',
|
|
118
|
-
`${BASE_URL}/orders/merchantid/${this.merchantId}`,
|
|
119
|
-
null, { status, startDate, endDate, page, size }
|
|
120
|
-
);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
async getOrderDetail(orderId) {
|
|
124
|
-
return await this._request('GET',
|
|
125
|
-
`${BASE_URL}/orders/merchantid/${this.merchantId}/id/${orderId}`
|
|
126
|
-
);
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
async confirmOrder(orderId) {
|
|
130
|
-
return await this._request('PUT',
|
|
131
|
-
`${BASE_URL}/orders/merchantid/${this.merchantId}/id/${orderId}/confirm`
|
|
132
|
-
);
|
|
133
|
-
}
|
|
134
|
-
|
|
135
|
-
async shipOrder(orderId, trackingNumber, cargoCompany) {
|
|
136
|
-
return await this._request('PUT',
|
|
137
|
-
`${BASE_URL}/orders/merchantid/${this.merchantId}/id/${orderId}/ship`,
|
|
138
|
-
{
|
|
139
|
-
trackingNumber,
|
|
140
|
-
cargoCompany
|
|
141
|
-
}
|
|
142
|
-
);
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
async cancelOrder(orderId, reason) {
|
|
146
|
-
return await this._request('PUT',
|
|
147
|
-
`${BASE_URL}/orders/merchantid/${this.merchantId}/id/${orderId}/cancel`,
|
|
148
|
-
{ reason }
|
|
149
|
-
);
|
|
150
|
-
}
|
|
151
|
-
|
|
152
|
-
// ═══════════════════════════════════════════════════════════════════════════
|
|
153
|
-
// KATEGORİ
|
|
154
|
-
// ═══════════════════════════════════════════════════════════════════════════
|
|
155
|
-
|
|
156
|
-
async getCategories() {
|
|
157
|
-
return await this._request('GET', `${LISTING_URL}/categories/get-all-categories`);
|
|
158
|
-
}
|
|
159
|
-
|
|
160
|
-
async getCategoryAttributes(categoryId) {
|
|
161
|
-
return await this._request('GET',
|
|
162
|
-
`${LISTING_URL}/product-attributes/category/${categoryId}`
|
|
163
|
-
);
|
|
164
|
-
}
|
|
165
|
-
|
|
166
|
-
// ═══════════════════════════════════════════════════════════════════════════
|
|
167
|
-
// HELPER
|
|
168
|
-
// ═══════════════════════════════════════════════════════════════════════════
|
|
169
|
-
|
|
170
|
-
async testConnection() {
|
|
171
|
-
const result = await this.getProducts({ page: 0, size: 1 });
|
|
172
|
-
return result.success;
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
isConnected() {
|
|
176
|
-
return !!(this.merchantId && this.username && this.password);
|
|
177
|
-
}
|
|
178
|
-
}
|
|
179
|
-
|
|
180
|
-
let instance = null;
|
|
181
|
-
|
|
182
|
-
export const hepsiburadaApi = {
|
|
183
|
-
init(config) {
|
|
184
|
-
instance = new HepsiburadaAPI(config);
|
|
185
|
-
return instance;
|
|
186
|
-
},
|
|
187
|
-
getInstance() { return instance; },
|
|
188
|
-
isConnected() { return instance?.isConnected() || false; },
|
|
189
|
-
|
|
190
|
-
async getProducts(params) { return instance?.getProducts(params); },
|
|
191
|
-
async updatePrice(sku, price) { return instance?.updatePrice(sku, price); },
|
|
192
|
-
async updateStock(sku, qty) { return instance?.updateStock(sku, qty); },
|
|
193
|
-
async getOrders(params) { return instance?.getOrders(params); }
|
|
194
|
-
};
|
|
43
|
+
} catch (error) {
|
|
44
|
+
return {
|
|
45
|
+
success: false,
|
|
46
|
+
error: error.response?.data || error.message
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
52
|
+
// ÜRÜN İŞLEMLERİ
|
|
53
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
54
|
+
|
|
55
|
+
async getProducts(params = {}) {
|
|
56
|
+
const { page = 0, size = 100, sku } = params;
|
|
57
|
+
return await this._request('GET',
|
|
58
|
+
`${LISTING_URL}/Listings/merchantid/${this.merchantId}`,
|
|
59
|
+
null, { page, size, merchantSku: sku }
|
|
60
|
+
);
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
async createProduct(product) {
|
|
64
|
+
// product: { merchantSku, hepsiburadaSku, price, availableStock, ... }
|
|
65
|
+
return await this._request('POST',
|
|
66
|
+
`${LISTING_URL}/Listings/merchantid/${this.merchantId}/sku/${product.hepsiburadaSku}`,
|
|
67
|
+
product
|
|
68
|
+
);
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
async updatePrice(merchantSku, price) {
|
|
72
|
+
return await this._request('POST',
|
|
73
|
+
`${LISTING_URL}/Listings/merchantid/${this.merchantId}`,
|
|
74
|
+
{
|
|
75
|
+
listings: [{
|
|
76
|
+
merchantSku,
|
|
77
|
+
price,
|
|
78
|
+
currency: 'TRY'
|
|
79
|
+
}]
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
}
|
|
83
|
+
|
|
84
|
+
async updateStock(merchantSku, stock) {
|
|
85
|
+
return await this._request('POST',
|
|
86
|
+
`${LISTING_URL}/Listings/merchantid/${this.merchantId}`,
|
|
87
|
+
{
|
|
88
|
+
listings: [{
|
|
89
|
+
merchantSku,
|
|
90
|
+
availableStock: stock
|
|
91
|
+
}]
|
|
92
|
+
}
|
|
93
|
+
);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
async bulkUpdate(listings) {
|
|
97
|
+
// listings: [{ merchantSku, price?, availableStock? }]
|
|
98
|
+
return await this._request('POST',
|
|
99
|
+
`${LISTING_URL}/Listings/merchantid/${this.merchantId}`,
|
|
100
|
+
{ listings }
|
|
101
|
+
);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
105
|
+
// SİPARİŞ İŞLEMLERİ
|
|
106
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
107
|
+
|
|
108
|
+
async getOrders(params = {}) {
|
|
109
|
+
const {
|
|
110
|
+
status, // Open, Shipped, Delivered, Cancelled
|
|
111
|
+
startDate,
|
|
112
|
+
endDate,
|
|
113
|
+
page = 0,
|
|
114
|
+
size = 50
|
|
115
|
+
} = params;
|
|
116
|
+
|
|
117
|
+
return await this._request('GET',
|
|
118
|
+
`${BASE_URL}/orders/merchantid/${this.merchantId}`,
|
|
119
|
+
null, { status, startDate, endDate, page, size }
|
|
120
|
+
);
|
|
121
|
+
}
|
|
122
|
+
|
|
123
|
+
async getOrderDetail(orderId) {
|
|
124
|
+
return await this._request('GET',
|
|
125
|
+
`${BASE_URL}/orders/merchantid/${this.merchantId}/id/${orderId}`
|
|
126
|
+
);
|
|
127
|
+
}
|
|
128
|
+
|
|
129
|
+
async confirmOrder(orderId) {
|
|
130
|
+
return await this._request('PUT',
|
|
131
|
+
`${BASE_URL}/orders/merchantid/${this.merchantId}/id/${orderId}/confirm`
|
|
132
|
+
);
|
|
133
|
+
}
|
|
134
|
+
|
|
135
|
+
async shipOrder(orderId, trackingNumber, cargoCompany) {
|
|
136
|
+
return await this._request('PUT',
|
|
137
|
+
`${BASE_URL}/orders/merchantid/${this.merchantId}/id/${orderId}/ship`,
|
|
138
|
+
{
|
|
139
|
+
trackingNumber,
|
|
140
|
+
cargoCompany
|
|
141
|
+
}
|
|
142
|
+
);
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
async cancelOrder(orderId, reason) {
|
|
146
|
+
return await this._request('PUT',
|
|
147
|
+
`${BASE_URL}/orders/merchantid/${this.merchantId}/id/${orderId}/cancel`,
|
|
148
|
+
{ reason }
|
|
149
|
+
);
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
153
|
+
// KATEGORİ
|
|
154
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
155
|
+
|
|
156
|
+
async getCategories() {
|
|
157
|
+
return await this._request('GET', `${LISTING_URL}/categories/get-all-categories`);
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
async getCategoryAttributes(categoryId) {
|
|
161
|
+
return await this._request('GET',
|
|
162
|
+
`${LISTING_URL}/product-attributes/category/${categoryId}`
|
|
163
|
+
);
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
167
|
+
// HELPER
|
|
168
|
+
// ═══════════════════════════════════════════════════════════════════════════
|
|
169
|
+
|
|
170
|
+
async testConnection() {
|
|
171
|
+
const result = await this.getProducts({ page: 0, size: 1 });
|
|
172
|
+
return result.success;
|
|
173
|
+
}
|
|
174
|
+
|
|
175
|
+
isConnected() {
|
|
176
|
+
return !!(this.merchantId && this.username && this.password);
|
|
177
|
+
}
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
let instance = null;
|
|
181
|
+
|
|
182
|
+
export const hepsiburadaApi = {
|
|
183
|
+
init(config) {
|
|
184
|
+
instance = new HepsiburadaAPI(config);
|
|
185
|
+
return instance;
|
|
186
|
+
},
|
|
187
|
+
getInstance() { return instance; },
|
|
188
|
+
isConnected() { return instance?.isConnected() || false; },
|
|
189
|
+
|
|
190
|
+
async getProducts(params) { return instance?.getProducts(params); },
|
|
191
|
+
async updatePrice(sku, price) { return instance?.updatePrice(sku, price); },
|
|
192
|
+
async updateStock(sku, qty) { return instance?.updateStock(sku, qty); },
|
|
193
|
+
async getOrders(params) { return instance?.getOrders(params); }
|
|
194
|
+
};
|