@things-factory/integration-sellercraft 4.3.19 → 4.3.20
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 +15 -15
- package/server/routers/sellercraft-router.ts +18 -8
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@things-factory/integration-sellercraft",
|
3
|
-
"version": "4.3.
|
3
|
+
"version": "4.3.20",
|
4
4
|
"main": "dist-server/index.js",
|
5
5
|
"browser": "client/index.js",
|
6
6
|
"things-factory": true,
|
@@ -24,19 +24,19 @@
|
|
24
24
|
"migration:create": "node ../../node_modules/typeorm/cli.js migration:create -d ./server/migrations"
|
25
25
|
},
|
26
26
|
"dependencies": {
|
27
|
-
"@things-factory/apptool-ui": "^4.3.
|
28
|
-
"@things-factory/auth-ui": "^4.3.
|
29
|
-
"@things-factory/biz-base": "^4.3.
|
30
|
-
"@things-factory/code-ui": "^4.3.
|
31
|
-
"@things-factory/context-ui": "^4.3.
|
32
|
-
"@things-factory/grist-ui": "^4.3.
|
33
|
-
"@things-factory/i18n-base": "^4.3.
|
34
|
-
"@things-factory/integration-marketplace": "^4.3.
|
35
|
-
"@things-factory/integration-ui": "^4.3.
|
36
|
-
"@things-factory/more-ui": "^4.3.
|
37
|
-
"@things-factory/resource-ui": "^4.3.
|
38
|
-
"@things-factory/setting-ui": "^4.3.
|
39
|
-
"@things-factory/system-ui": "^4.3.
|
27
|
+
"@things-factory/apptool-ui": "^4.3.20",
|
28
|
+
"@things-factory/auth-ui": "^4.3.20",
|
29
|
+
"@things-factory/biz-base": "^4.3.20",
|
30
|
+
"@things-factory/code-ui": "^4.3.20",
|
31
|
+
"@things-factory/context-ui": "^4.3.20",
|
32
|
+
"@things-factory/grist-ui": "^4.3.20",
|
33
|
+
"@things-factory/i18n-base": "^4.3.20",
|
34
|
+
"@things-factory/integration-marketplace": "^4.3.20",
|
35
|
+
"@things-factory/integration-ui": "^4.3.20",
|
36
|
+
"@things-factory/more-ui": "^4.3.20",
|
37
|
+
"@things-factory/resource-ui": "^4.3.20",
|
38
|
+
"@things-factory/setting-ui": "^4.3.20",
|
39
|
+
"@things-factory/system-ui": "^4.3.20",
|
40
40
|
"debug": "^4.1.1",
|
41
41
|
"node-fetch": "^2.6.0",
|
42
42
|
"querystring": "^0.2.1"
|
@@ -51,5 +51,5 @@
|
|
51
51
|
"nock": "^13.0.2",
|
52
52
|
"should": "^13.2.3"
|
53
53
|
},
|
54
|
-
"gitHead": "
|
54
|
+
"gitHead": "2f86da10f36746b46428bc7408b586d0ec8aa793"
|
55
55
|
}
|
@@ -47,13 +47,14 @@ sellercraftRouter.post('/sellercraft/store/update-product-price', async (context
|
|
47
47
|
}
|
48
48
|
|
49
49
|
try {
|
50
|
-
if (requestBody[i].native_variant_id != requestBody[i].native_product_id) {
|
50
|
+
if (requestBody[i].variant.native_variant_id != requestBody[i].native_product_id) {
|
51
51
|
const req = {
|
52
52
|
costPrice: requestBody[i].variant.full_price,
|
53
53
|
sellPrice: requestBody[i].variant.sale_price,
|
54
54
|
productId: requestBody[i].native_product_id,
|
55
55
|
variationId: requestBody[i].variant.native_variant_id,
|
56
|
-
variationSku: requestBody[i].variant.sku
|
56
|
+
variationSku: requestBody[i].variant.sku,
|
57
|
+
context: { state: { domain: null } }
|
57
58
|
}
|
58
59
|
result = await StoreAPI.updateStoreProductVariationPrice(mappedStore, req)
|
59
60
|
} else {
|
@@ -61,7 +62,8 @@ sellercraftRouter.post('/sellercraft/store/update-product-price', async (context
|
|
61
62
|
costPrice: requestBody[i].variant.full_price,
|
62
63
|
sellPrice: requestBody[i].variant.sale_price,
|
63
64
|
productId: requestBody[i].native_product_id,
|
64
|
-
variationSku: requestBody[i].variant.sku
|
65
|
+
variationSku: requestBody[i].variant.sku,
|
66
|
+
context: { state: { domain: null } }
|
65
67
|
}
|
66
68
|
result = await StoreAPI.updateStoreProductPrice(mappedStore, req)
|
67
69
|
}
|
@@ -115,13 +117,14 @@ sellercraftRouter.post('/sellercraft/store/update-product-stock', async (context
|
|
115
117
|
}
|
116
118
|
|
117
119
|
try {
|
118
|
-
if (requestBody[i].native_variant_id != requestBody[i].native_product_id) {
|
120
|
+
if (requestBody[i].variant.native_variant_id != requestBody[i].native_product_id) {
|
119
121
|
const req = {
|
120
122
|
qty: requestBody[i].variant.stock,
|
121
123
|
itemId: requestBody[i].native_product_id,
|
122
124
|
variationId: requestBody[i].variant.native_variant_id,
|
123
125
|
distributors: requestBody[i].distributors || [], // for Magento
|
124
|
-
variationSku: requestBody[i].variant.sku
|
126
|
+
variationSku: requestBody[i].variant.sku,
|
127
|
+
context: { state: { domain: null } }
|
125
128
|
}
|
126
129
|
result = await StoreAPI.updateStoreProductVariationStock(mappedStore, req)
|
127
130
|
} else {
|
@@ -129,7 +132,8 @@ sellercraftRouter.post('/sellercraft/store/update-product-stock', async (context
|
|
129
132
|
qty: requestBody[i].variant.stock,
|
130
133
|
itemId: requestBody[i].native_product_id,
|
131
134
|
distributors: requestBody[i].distributors || [], // for Magento
|
132
|
-
variationSku: requestBody[i].variant.sku
|
135
|
+
variationSku: requestBody[i].variant.sku,
|
136
|
+
context: { state: { domain: null } }
|
133
137
|
}
|
134
138
|
result = await StoreAPI.updateStoreProductStock(mappedStore, req)
|
135
139
|
}
|
@@ -188,7 +192,8 @@ sellercraftRouter.post('/sellercraft/store/update-order-status', async (context,
|
|
188
192
|
carrier: requestBody?.shipper_last_mile,
|
189
193
|
trackingNo: requestBody?.tracking_number,
|
190
194
|
orderItems: requestBody?.order_items,
|
191
|
-
isSOF: requestBody?.seller_logistics
|
195
|
+
isSOF: requestBody?.seller_logistics,
|
196
|
+
context: { state: { domain: null } }
|
192
197
|
}
|
193
198
|
|
194
199
|
let responseBody: any = { operation_id: uuid() }
|
@@ -333,7 +338,12 @@ sellercraftRouter.post('/sellercraft/store/update-product-attribute', async (con
|
|
333
338
|
for (var i = 0; i < variants.length; i++) {
|
334
339
|
try {
|
335
340
|
let variant = variants[i]
|
336
|
-
await StoreAPI.updateProductAttribute(mappedStore, {
|
341
|
+
await StoreAPI.updateProductAttribute(mappedStore, {
|
342
|
+
productSku,
|
343
|
+
itemId,
|
344
|
+
variant,
|
345
|
+
context: { state: { domain: null } }
|
346
|
+
})
|
337
347
|
context.type = 'application/json'
|
338
348
|
context.status = 200
|
339
349
|
context.body = 'Succeeded'
|