eprolo-cli 1.0.104 → 1.0.106
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 +11 -6
- package/package.json +1 -1
package/bin/eprolo-cli.js
CHANGED
|
@@ -283,11 +283,13 @@ async function insertProduct(arg) {
|
|
|
283
283
|
async function addOrder(arg) {
|
|
284
284
|
const config = readConfig();
|
|
285
285
|
const order = JSON.parse(arg);
|
|
286
|
+
console.log("-----------------",order);
|
|
286
287
|
const newOrder={};
|
|
287
288
|
const orderItemlist=[];
|
|
288
289
|
newOrder.note=order.name;
|
|
289
290
|
newOrder.shipping_country_code=order.currencyCode;
|
|
290
291
|
newOrder.order_id=getId(order.id);
|
|
292
|
+
newOrder.order_number=order.name;
|
|
291
293
|
if(order.shippingAddress){
|
|
292
294
|
newOrder.shipping_name=order.shippingAddress.firstName + ' ' + order.shippingAddress.lastName;
|
|
293
295
|
newOrder.shipping_phone=order.shippingAddress.phone
|
|
@@ -300,13 +302,16 @@ async function addOrder(arg) {
|
|
|
300
302
|
newOrder.shipping_city=order.shippingAddress.city;
|
|
301
303
|
// newOrder.shipping_taxNumber=order.shippingAddress.taxNumber;
|
|
302
304
|
}
|
|
303
|
-
order.lineItems
|
|
305
|
+
if(order.lineItems){
|
|
306
|
+
order.lineItems.edges.forEach((edge)=>{
|
|
304
307
|
orderItemlist.push({
|
|
305
|
-
variantsid:getId(edge.variant.id),
|
|
306
|
-
quantity:edge.quantity,
|
|
308
|
+
variantsid:getId(edge.node.variant.id),
|
|
309
|
+
quantity:edge.node.quantity,
|
|
307
310
|
})
|
|
308
|
-
|
|
309
|
-
|
|
311
|
+
})
|
|
312
|
+
newOrder.orderItemlist=orderItemlist;
|
|
313
|
+
}
|
|
314
|
+
console.log("-------222----------",newOrder);
|
|
310
315
|
const data = await postJsonWithRetry(`http://43.153.35.208:3000/addInfo`, newOrder, config, "POST");
|
|
311
316
|
console.log(JSON.stringify(data, null, 2));
|
|
312
317
|
process.exit(0);
|
|
@@ -354,7 +359,7 @@ Credential file (~/.eprolo-toolkit/config.json):
|
|
|
354
359
|
|
|
355
360
|
async function main() {
|
|
356
361
|
const argv = process.argv.slice(2);
|
|
357
|
-
|
|
362
|
+
console.log("-----------------",argv);
|
|
358
363
|
if (argv[0] === "auth" && argv[1] === "login") {
|
|
359
364
|
await login(argv.slice(2));
|
|
360
365
|
return;
|
package/package.json
CHANGED