@things-factory/integration-sellercraft 4.3.14 → 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 CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@things-factory/integration-sellercraft",
3
- "version": "4.3.14",
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.14",
28
- "@things-factory/auth-ui": "^4.3.14",
29
- "@things-factory/biz-base": "^4.3.14",
30
- "@things-factory/code-ui": "^4.3.14",
31
- "@things-factory/context-ui": "^4.3.14",
32
- "@things-factory/grist-ui": "^4.3.14",
33
- "@things-factory/i18n-base": "^4.3.14",
34
- "@things-factory/integration-marketplace": "^4.3.14",
35
- "@things-factory/integration-ui": "^4.3.14",
36
- "@things-factory/more-ui": "^4.3.14",
37
- "@things-factory/resource-ui": "^4.3.14",
38
- "@things-factory/setting-ui": "^4.3.14",
39
- "@things-factory/system-ui": "^4.3.14",
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": "d99f715c7ac6f520c23d6ff95d85b26bff892590"
54
+ "gitHead": "2f86da10f36746b46428bc7408b586d0ec8aa793"
55
55
  }
@@ -47,21 +47,23 @@ 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
- costPrice: requestBody[i].full_price,
53
- sellPrice: requestBody[i].sale_price,
52
+ costPrice: requestBody[i].variant.full_price,
53
+ sellPrice: requestBody[i].variant.sale_price,
54
54
  productId: requestBody[i].native_product_id,
55
- variationId: requestBody[i].native_variant_id,
56
- variationSku: requestBody[i].sku
55
+ variationId: requestBody[i].variant.native_variant_id,
56
+ variationSku: requestBody[i].variant.sku,
57
+ context: { state: { domain: null } }
57
58
  }
58
59
  result = await StoreAPI.updateStoreProductVariationPrice(mappedStore, req)
59
60
  } else {
60
61
  const req = {
61
- costPrice: requestBody[i].full_price,
62
- sellPrice: requestBody[i].sale_price,
62
+ costPrice: requestBody[i].variant.full_price,
63
+ sellPrice: requestBody[i].variant.sale_price,
63
64
  productId: requestBody[i].native_product_id,
64
- variationSku: requestBody[i].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,21 +117,23 @@ 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
- qty: requestBody[i].stock,
122
+ qty: requestBody[i].variant.stock,
121
123
  itemId: requestBody[i].native_product_id,
122
- variationId: requestBody[i].native_variant_id,
124
+ variationId: requestBody[i].variant.native_variant_id,
123
125
  distributors: requestBody[i].distributors || [], // for Magento
124
- variationSku: requestBody[i].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 {
128
131
  const req = {
129
- qty: requestBody[i].stock,
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].sku
135
+ variationSku: requestBody[i].variant.sku,
136
+ context: { state: { domain: null } }
133
137
  }
134
138
  result = await StoreAPI.updateStoreProductStock(mappedStore, req)
135
139
  }
@@ -187,8 +191,9 @@ sellercraftRouter.post('/sellercraft/store/update-order-status', async (context,
187
191
  status: requestBody.order_status,
188
192
  carrier: requestBody?.shipper_last_mile,
189
193
  trackingNo: requestBody?.tracking_number,
190
- orderItems: requestBody?.order_item_ids,
191
- isSOF: requestBody?.seller_logistics
194
+ orderItems: requestBody?.order_items,
195
+ isSOF: requestBody?.seller_logistics,
196
+ context: { state: { domain: null } }
192
197
  }
193
198
 
194
199
  let responseBody: any = { operation_id: uuid() }
@@ -244,7 +249,11 @@ sellercraftRouter.post('/sellercraft/store/update-order-status', async (context,
244
249
  name: orderPackage.shippingProvider,
245
250
  is_cod_supported: orderPackage?.isCodSupport ? orderPackage.isCodSupport : false
246
251
  },
247
- order_item_ids: orderPackage?.orderListIdList ? orderPackage.orderListIdList : reqBody.orderItems
252
+ order_item_ids: orderPackage?.orderListIdList
253
+ ? orderPackage.orderListIdList
254
+ : reqBody.orderItems.map(oi => {
255
+ return oi.native_order_item_id
256
+ })
248
257
  } || {}
249
258
 
250
259
  responseBody.package = newOrderPackage
@@ -329,7 +338,12 @@ sellercraftRouter.post('/sellercraft/store/update-product-attribute', async (con
329
338
  for (var i = 0; i < variants.length; i++) {
330
339
  try {
331
340
  let variant = variants[i]
332
- await StoreAPI.updateProductAttribute(mappedStore, { productSku, itemId, variant })
341
+ await StoreAPI.updateProductAttribute(mappedStore, {
342
+ productSku,
343
+ itemId,
344
+ variant,
345
+ context: { state: { domain: null } }
346
+ })
333
347
  context.type = 'application/json'
334
348
  context.status = 200
335
349
  context.body = 'Succeeded'