eprolo-cli 1.0.106 → 1.0.108
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/bin/eprolo-cli.js +13 -3
- package/package.json +1 -1
package/bin/eprolo-cli.js
CHANGED
|
@@ -269,7 +269,12 @@ async function insertProduct(arg) {
|
|
|
269
269
|
if(data.data.msg=="product_id exist"){
|
|
270
270
|
const result = await postJsonWithRetry(BASE_URL+'/getproduct.html', {product_id:info.product_id}, config);
|
|
271
271
|
if(result.data.code==0){
|
|
272
|
-
console.log(JSON.stringify({
|
|
272
|
+
console.log(JSON.stringify({variantlist:result.data.data.variantsList.map((item)=>{
|
|
273
|
+
return {
|
|
274
|
+
variantsid:item.id,
|
|
275
|
+
sku:item.sku
|
|
276
|
+
}
|
|
277
|
+
})}, null, 2));
|
|
273
278
|
process.exit(0);
|
|
274
279
|
}
|
|
275
280
|
}else{
|
|
@@ -277,7 +282,12 @@ async function insertProduct(arg) {
|
|
|
277
282
|
process.exit(0);
|
|
278
283
|
}
|
|
279
284
|
}
|
|
280
|
-
|
|
285
|
+
console.log(JSON.stringify({variantlist:data.data.data.variantsList.map((item)=>{
|
|
286
|
+
return {
|
|
287
|
+
variantsid:item.id,
|
|
288
|
+
sku:item.sku
|
|
289
|
+
}
|
|
290
|
+
})}, null, 2));
|
|
281
291
|
process.exit(0);
|
|
282
292
|
}
|
|
283
293
|
async function addOrder(arg) {
|
|
@@ -302,7 +312,7 @@ async function addOrder(arg) {
|
|
|
302
312
|
newOrder.shipping_city=order.shippingAddress.city;
|
|
303
313
|
// newOrder.shipping_taxNumber=order.shippingAddress.taxNumber;
|
|
304
314
|
}
|
|
305
|
-
if(order.lineItems){
|
|
315
|
+
if(order.lineItems && order.lineItems.edges){
|
|
306
316
|
order.lineItems.edges.forEach((edge)=>{
|
|
307
317
|
orderItemlist.push({
|
|
308
318
|
variantsid:getId(edge.node.variant.id),
|
package/package.json
CHANGED