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.
Files changed (70) hide show
  1. package/LICENSE +45 -45
  2. package/admin-keygen.js +51 -0
  3. package/cli.js +685 -585
  4. package/config.js +733 -733
  5. package/core/agent-loop.js +190 -190
  6. package/core/ai-provider.js +298 -261
  7. package/core/automation.js +523 -523
  8. package/core/brand-analyst.js +101 -0
  9. package/core/channels.js +167 -167
  10. package/core/dashboard.js +230 -230
  11. package/core/database.js +135 -37
  12. package/core/eia-monitor.js +3 -1
  13. package/core/engine.js +648 -636
  14. package/core/gateway.js +447 -447
  15. package/core/learning.js +214 -214
  16. package/core/license.js +113 -0
  17. package/core/marketplace-adapter.js +168 -168
  18. package/core/memory.js +190 -190
  19. package/core/migrations/001-initial-schema.sql +1 -1
  20. package/core/queue.js +120 -120
  21. package/core/self-healer.js +314 -314
  22. package/core/unified-product.js +214 -214
  23. package/core/vision-service.js +113 -113
  24. package/index.js +217 -174
  25. package/modules/crm/sentiment-crm.js +231 -231
  26. package/modules/healer/listing-healer.js +201 -201
  27. package/modules/oracle/predictor.js +214 -214
  28. package/modules/researcher/agent.js +169 -169
  29. package/modules/team/agents/base.js +92 -92
  30. package/modules/team/agents/dev.js +33 -33
  31. package/modules/team/agents/josh.js +40 -40
  32. package/modules/team/agents/marketing.js +33 -33
  33. package/modules/team/agents/milo.js +36 -36
  34. package/modules/team/index.js +78 -78
  35. package/modules/team/shared-memory.js +87 -87
  36. package/modules/war-room/competitor-tracker.js +250 -250
  37. package/modules/war-room/pricing-engine.js +308 -308
  38. package/nodes/warehouse.js +238 -238
  39. package/onboard.js +1 -1
  40. package/package.json +7 -5
  41. package/platforms/pttavm.js +14 -14
  42. package/plugins/vantuz/index.js +528 -528
  43. package/plugins/vantuz/memory/hippocampus.js +465 -465
  44. package/plugins/vantuz/package.json +20 -20
  45. package/plugins/vantuz/platforms/_template.js +118 -118
  46. package/plugins/vantuz/platforms/amazon.js +236 -236
  47. package/plugins/vantuz/platforms/ciceksepeti.js +166 -166
  48. package/plugins/vantuz/platforms/hepsiburada.js +180 -180
  49. package/plugins/vantuz/platforms/index.js +165 -165
  50. package/plugins/vantuz/platforms/n11.js +229 -229
  51. package/plugins/vantuz/platforms/pazarama.js +154 -154
  52. package/plugins/vantuz/platforms/pttavm.js +127 -127
  53. package/plugins/vantuz/platforms/trendyol.js +326 -326
  54. package/plugins/vantuz/services/alerts.js +253 -253
  55. package/plugins/vantuz/services/license.js +34 -34
  56. package/plugins/vantuz/services/scheduler.js +232 -232
  57. package/plugins/vantuz/tools/analytics.js +152 -152
  58. package/plugins/vantuz/tools/crossborder.js +187 -187
  59. package/plugins/vantuz/tools/nl-parser.js +211 -211
  60. package/plugins/vantuz/tools/product.js +110 -110
  61. package/plugins/vantuz/tools/quick-report.js +175 -175
  62. package/plugins/vantuz/tools/repricer.js +314 -314
  63. package/plugins/vantuz/tools/sentiment.js +115 -115
  64. package/plugins/vantuz/tools/vision.js +257 -257
  65. package/private.pem +28 -0
  66. package/public.pem +9 -0
  67. package/server/app.js +260 -260
  68. package/server/public/index.html +514 -514
  69. package/start.bat +33 -33
  70. package/vantuz.sqlite +0 -0
@@ -1,28 +1,28 @@
1
- /**
2
- * 🌸 Γ‡Δ°Γ‡EKSEPETΔ° API Entegrasyonu
3
- * bayi.ciceksepeti.com
4
- */
5
-
1
+ /**
2
+ * 🌸 Γ‡Δ°Γ‡EKSEPETΔ° API Entegrasyonu
3
+ * bayi.ciceksepeti.com
4
+ */
5
+
6
6
  import axios from 'axios';
7
7
  import { requestWithRetry } from './_request.js';
8
-
9
- const BASE_URL = 'https://apis.ciceksepeti.com/api/v1';
10
-
11
- export class CiceksepetiAPI {
12
- constructor(config) {
13
- this.apiKey = config.apiKey;
14
- this.supplierId = config.supplierId;
15
- }
16
-
17
- _headers() {
18
- return {
19
- 'x-api-key': this.apiKey,
20
- 'Content-Type': 'application/json'
21
- };
22
- }
23
-
24
- async _request(method, endpoint, data = null, params = null) {
25
- try {
8
+
9
+ const BASE_URL = 'https://apis.ciceksepeti.com/api/v1';
10
+
11
+ export class CiceksepetiAPI {
12
+ constructor(config) {
13
+ this.apiKey = config.apiKey;
14
+ this.supplierId = config.supplierId;
15
+ }
16
+
17
+ _headers() {
18
+ return {
19
+ 'x-api-key': this.apiKey,
20
+ 'Content-Type': 'application/json'
21
+ };
22
+ }
23
+
24
+ async _request(method, endpoint, data = null, params = null) {
25
+ try {
26
26
  const response = await requestWithRetry(axios, {
27
27
  method,
28
28
  url: `${BASE_URL}${endpoint}`,
@@ -35,146 +35,146 @@ export class CiceksepetiAPI {
35
35
  maxDelayMs: 4000
36
36
  });
37
37
  return { success: true, data: response.data };
38
- } catch (error) {
39
- return {
40
- success: false,
41
- error: error.response?.data || error.message
42
- };
43
- }
44
- }
45
-
46
- // ═══════════════════════════════════════════════════════════════════════════
47
- // ÜRÜN İŞLEMLERİ
48
- // ═══════════════════════════════════════════════════════════════════════════
49
-
50
- async getProducts(params = {}) {
51
- const { page = 1, pageSize = 100, stockCode } = params;
52
- return await this._request('GET', '/products', null, {
53
- page, pageSize, stockCode
54
- });
55
- }
56
-
57
- async getProductByStockCode(stockCode) {
58
- const result = await this.getProducts({ stockCode });
59
- if (result.success && result.data.products?.length > 0) {
60
- return { success: true, data: result.data.products[0] };
61
- }
62
- return { success: false, error: 'Ürün bulunamadı' };
63
- }
64
-
65
- async updateProduct(product) {
66
- return await this._request('PUT', '/products', {
67
- items: [product]
68
- });
69
- }
70
-
71
- async updatePrice(stockCode, salesPrice, listPrice = null) {
72
- return await this._request('PUT', '/products/price-and-stock', {
73
- items: [{
74
- stockCode,
75
- salesPrice,
76
- listPrice: listPrice || salesPrice
77
- }]
78
- });
79
- }
80
-
81
- async updateStock(stockCode, stockQuantity) {
82
- return await this._request('PUT', '/products/price-and-stock', {
83
- items: [{
84
- stockCode,
85
- stockQuantity
86
- }]
87
- });
88
- }
89
-
90
- async bulkUpdate(items) {
91
- // items: [{ stockCode, salesPrice?, stockQuantity? }]
92
- return await this._request('PUT', '/products/price-and-stock', { items });
93
- }
94
-
95
- // ═══════════════════════════════════════════════════════════════════════════
96
- // SİPARİŞ İŞLEMLERİ
97
- // ═══════════════════════════════════════════════════════════════════════════
98
-
99
- async getOrders(params = {}) {
100
- const {
101
- startDate,
102
- endDate,
103
- page = 1,
104
- pageSize = 100,
105
- orderStatus // 1: Yeni, 2: HazΔ±rlanΔ±yor, 3: Kargoda, 4: Teslim
106
- } = params;
107
-
108
- return await this._request('GET', '/orders', null, {
109
- startDate, endDate, page, pageSize, orderStatus
110
- });
111
- }
112
-
113
- async getOrderDetail(orderId) {
114
- return await this._request('GET', `/orders/${orderId}`);
115
- }
116
-
117
- async updateOrderStatus(orderId, status, trackingNumber = null) {
118
- const data = { orderStatus: status };
119
- if (trackingNumber) {
120
- data.cargoTrackingNumber = trackingNumber;
121
- }
122
- return await this._request('PUT', `/orders/${orderId}`, data);
123
- }
124
-
125
- async shipOrder(orderId, trackingNumber, cargoCompanyId = 1) {
126
- return await this._request('PUT', `/orders/${orderId}/ship`, {
127
- cargoCompanyId,
128
- cargoTrackingNumber: trackingNumber
129
- });
130
- }
131
-
132
- // ═══════════════════════════════════════════════════════════════════════════
133
- // KATEGORΔ°
134
- // ═══════════════════════════════════════════════════════════════════════════
135
-
136
- async getCategories() {
137
- return await this._request('GET', '/categories');
138
- }
139
-
140
- async getCategoryAttributes(categoryId) {
141
- return await this._request('GET', `/categories/${categoryId}/attributes`);
142
- }
143
-
144
- // ═══════════════════════════════════════════════════════════════════════════
145
- // KARGO
146
- // ═══════════════════════════════════════════════════════════════════════════
147
-
148
- async getCargoCompanies() {
149
- return await this._request('GET', '/cargo-companies');
150
- }
151
-
152
- // ═══════════════════════════════════════════════════════════════════════════
153
- // HELPER
154
- // ═══════════════════════════════════════════════════════════════════════════
155
-
156
- async testConnection() {
157
- const result = await this.getProducts({ page: 1, pageSize: 1 });
158
- return result.success;
159
- }
160
-
161
- isConnected() {
162
- return !!(this.apiKey);
163
- }
164
- }
165
-
166
- let instance = null;
167
-
168
- export const ciceksepetiApi = {
169
- init(config) {
170
- instance = new CiceksepetiAPI(config);
171
- return instance;
172
- },
173
- getInstance() { return instance; },
174
- isConnected() { return instance?.isConnected() || false; },
175
-
176
- async getProducts(params) { return instance?.getProducts(params); },
177
- async updatePrice(code, price) { return instance?.updatePrice(code, price); },
178
- async updateStock(code, qty) { return instance?.updateStock(code, qty); },
179
- async getOrders(params) { return instance?.getOrders(params); }
180
- };
38
+ } catch (error) {
39
+ return {
40
+ success: false,
41
+ error: error.response?.data || error.message
42
+ };
43
+ }
44
+ }
45
+
46
+ // ═══════════════════════════════════════════════════════════════════════════
47
+ // ÜRÜN İŞLEMLERİ
48
+ // ═══════════════════════════════════════════════════════════════════════════
49
+
50
+ async getProducts(params = {}) {
51
+ const { page = 1, pageSize = 100, stockCode } = params;
52
+ return await this._request('GET', '/products', null, {
53
+ page, pageSize, stockCode
54
+ });
55
+ }
56
+
57
+ async getProductByStockCode(stockCode) {
58
+ const result = await this.getProducts({ stockCode });
59
+ if (result.success && result.data.products?.length > 0) {
60
+ return { success: true, data: result.data.products[0] };
61
+ }
62
+ return { success: false, error: 'Ürün bulunamadı' };
63
+ }
64
+
65
+ async updateProduct(product) {
66
+ return await this._request('PUT', '/products', {
67
+ items: [product]
68
+ });
69
+ }
70
+
71
+ async updatePrice(stockCode, salesPrice, listPrice = null) {
72
+ return await this._request('PUT', '/products/price-and-stock', {
73
+ items: [{
74
+ stockCode,
75
+ salesPrice,
76
+ listPrice: listPrice || salesPrice
77
+ }]
78
+ });
79
+ }
80
+
81
+ async updateStock(stockCode, stockQuantity) {
82
+ return await this._request('PUT', '/products/price-and-stock', {
83
+ items: [{
84
+ stockCode,
85
+ stockQuantity
86
+ }]
87
+ });
88
+ }
89
+
90
+ async bulkUpdate(items) {
91
+ // items: [{ stockCode, salesPrice?, stockQuantity? }]
92
+ return await this._request('PUT', '/products/price-and-stock', { items });
93
+ }
94
+
95
+ // ═══════════════════════════════════════════════════════════════════════════
96
+ // SİPARİŞ İŞLEMLERİ
97
+ // ═══════════════════════════════════════════════════════════════════════════
98
+
99
+ async getOrders(params = {}) {
100
+ const {
101
+ startDate,
102
+ endDate,
103
+ page = 1,
104
+ pageSize = 100,
105
+ orderStatus // 1: Yeni, 2: HazΔ±rlanΔ±yor, 3: Kargoda, 4: Teslim
106
+ } = params;
107
+
108
+ return await this._request('GET', '/orders', null, {
109
+ startDate, endDate, page, pageSize, orderStatus
110
+ });
111
+ }
112
+
113
+ async getOrderDetail(orderId) {
114
+ return await this._request('GET', `/orders/${orderId}`);
115
+ }
116
+
117
+ async updateOrderStatus(orderId, status, trackingNumber = null) {
118
+ const data = { orderStatus: status };
119
+ if (trackingNumber) {
120
+ data.cargoTrackingNumber = trackingNumber;
121
+ }
122
+ return await this._request('PUT', `/orders/${orderId}`, data);
123
+ }
124
+
125
+ async shipOrder(orderId, trackingNumber, cargoCompanyId = 1) {
126
+ return await this._request('PUT', `/orders/${orderId}/ship`, {
127
+ cargoCompanyId,
128
+ cargoTrackingNumber: trackingNumber
129
+ });
130
+ }
131
+
132
+ // ═══════════════════════════════════════════════════════════════════════════
133
+ // KATEGORΔ°
134
+ // ═══════════════════════════════════════════════════════════════════════════
135
+
136
+ async getCategories() {
137
+ return await this._request('GET', '/categories');
138
+ }
139
+
140
+ async getCategoryAttributes(categoryId) {
141
+ return await this._request('GET', `/categories/${categoryId}/attributes`);
142
+ }
143
+
144
+ // ═══════════════════════════════════════════════════════════════════════════
145
+ // KARGO
146
+ // ═══════════════════════════════════════════════════════════════════════════
147
+
148
+ async getCargoCompanies() {
149
+ return await this._request('GET', '/cargo-companies');
150
+ }
151
+
152
+ // ═══════════════════════════════════════════════════════════════════════════
153
+ // HELPER
154
+ // ═══════════════════════════════════════════════════════════════════════════
155
+
156
+ async testConnection() {
157
+ const result = await this.getProducts({ page: 1, pageSize: 1 });
158
+ return result.success;
159
+ }
160
+
161
+ isConnected() {
162
+ return !!(this.apiKey);
163
+ }
164
+ }
165
+
166
+ let instance = null;
167
+
168
+ export const ciceksepetiApi = {
169
+ init(config) {
170
+ instance = new CiceksepetiAPI(config);
171
+ return instance;
172
+ },
173
+ getInstance() { return instance; },
174
+ isConnected() { return instance?.isConnected() || false; },
175
+
176
+ async getProducts(params) { return instance?.getProducts(params); },
177
+ async updatePrice(code, price) { return instance?.updatePrice(code, price); },
178
+ async updateStock(code, qty) { return instance?.updateStock(code, qty); },
179
+ async getOrders(params) { return instance?.getOrders(params); }
180
+ };