eprolo-cli 1.0.103 → 1.0.105
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 +29 -2
- package/package.json +1 -1
package/bin/eprolo-cli.js
CHANGED
|
@@ -282,7 +282,34 @@ async function insertProduct(arg) {
|
|
|
282
282
|
}
|
|
283
283
|
async function addOrder(arg) {
|
|
284
284
|
const config = readConfig();
|
|
285
|
-
const
|
|
285
|
+
const order = JSON.parse(arg);
|
|
286
|
+
console.log("-----------------",order);
|
|
287
|
+
const newOrder={};
|
|
288
|
+
const orderItemlist=[];
|
|
289
|
+
newOrder.note=order.name;
|
|
290
|
+
newOrder.shipping_country_code=order.currencyCode;
|
|
291
|
+
newOrder.order_id=getId(order.id);
|
|
292
|
+
if(order.shippingAddress){
|
|
293
|
+
newOrder.shipping_name=order.shippingAddress.firstName + ' ' + order.shippingAddress.lastName;
|
|
294
|
+
newOrder.shipping_phone=order.shippingAddress.phone
|
|
295
|
+
// newOrder.shipping_company=order.
|
|
296
|
+
newOrder.shipping_country=order.shippingAddress.country;
|
|
297
|
+
newOrder.shipping_address=order.shippingAddress.address1;
|
|
298
|
+
newOrder.shipping_province=order.shippingAddress.province;
|
|
299
|
+
// newOrder.shipping_province_code=order.shippingAddress.;
|
|
300
|
+
newOrder.shipping_address2=order.shippingAddress.address2
|
|
301
|
+
newOrder.shipping_city=order.shippingAddress.city;
|
|
302
|
+
// newOrder.shipping_taxNumber=order.shippingAddress.taxNumber;
|
|
303
|
+
}
|
|
304
|
+
order.lineItems.edges.forEach((edge)=>{
|
|
305
|
+
orderItemlist.push({
|
|
306
|
+
variantsid:getId(edge.node.variant.id),
|
|
307
|
+
quantity:edge.node.quantity,
|
|
308
|
+
})
|
|
309
|
+
})
|
|
310
|
+
newOrder.orderItemlist=orderItemlist;
|
|
311
|
+
console.log("-------222----------",newOrder);
|
|
312
|
+
const data = await postJsonWithRetry(`http://43.153.35.208:3000/addInfo`, newOrder, config, "POST");
|
|
286
313
|
console.log(JSON.stringify(data, null, 2));
|
|
287
314
|
process.exit(0);
|
|
288
315
|
}
|
|
@@ -329,7 +356,7 @@ Credential file (~/.eprolo-toolkit/config.json):
|
|
|
329
356
|
|
|
330
357
|
async function main() {
|
|
331
358
|
const argv = process.argv.slice(2);
|
|
332
|
-
|
|
359
|
+
console.log("-----------------",argv);
|
|
333
360
|
if (argv[0] === "auth" && argv[1] === "login") {
|
|
334
361
|
await login(argv.slice(2));
|
|
335
362
|
return;
|
package/package.json
CHANGED