eprolo-cli 1.0.125 → 1.0.127
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 +16 -3
- package/package.json +1 -1
package/bin/eprolo-cli.js
CHANGED
|
@@ -205,7 +205,7 @@ async function queryProductId(productId) {
|
|
|
205
205
|
console.error(JSON.stringify({ success: false, errorMessage: "缺少产品 ID" }));
|
|
206
206
|
process.exit(1);
|
|
207
207
|
}
|
|
208
|
-
const data = await postJsonWithRetry(
|
|
208
|
+
const data = await postJsonWithRetry("https://eprolo.com/app/getProductInfo.html", {id: productId}, config, "GET");
|
|
209
209
|
console.log(JSON.stringify(data, null, 2));
|
|
210
210
|
process.exit(0);
|
|
211
211
|
}
|
|
@@ -303,6 +303,14 @@ async function insertProduct(arg) {
|
|
|
303
303
|
}
|
|
304
304
|
async function placeOrder(arg) {
|
|
305
305
|
|
|
306
|
+
}
|
|
307
|
+
// 修改订单地址
|
|
308
|
+
async function modifyOrderAddress(arg){
|
|
309
|
+
const config = readConfig();
|
|
310
|
+
const product = JSON.parse(readPayload(arg));
|
|
311
|
+
const result = await postJsonWithRetry(BASE_URL + '/modify_order_address.html',product , config, "POST");
|
|
312
|
+
console.log(JSON.stringify(result, null, 2));
|
|
313
|
+
process.exit(0);
|
|
306
314
|
}
|
|
307
315
|
async function addOrder(arg) {
|
|
308
316
|
const config = readConfig();
|
|
@@ -360,8 +368,9 @@ Usage:
|
|
|
360
368
|
eprolo-cli product-list 查询产品列表
|
|
361
369
|
eprolo-cli orders 查询订单列表
|
|
362
370
|
eprolo-cli list 查询订单列表
|
|
363
|
-
eprolo-cli add-order <order>
|
|
364
|
-
eprolo-cli
|
|
371
|
+
eprolo-cli add-order <order> 提交订单
|
|
372
|
+
eprolo-cli modify-order-address <order> 修改订单地址
|
|
373
|
+
eprolo-cli insert-product <product> 插入产品
|
|
365
374
|
Authorization:
|
|
366
375
|
框架通过 fieldInjection 把表单值递交给 CLI:
|
|
367
376
|
userCode → env 通道 → process.env.EPROLO_USER_CODE
|
|
@@ -438,6 +447,10 @@ async function main() {
|
|
|
438
447
|
await placeOrder(argv[1]);
|
|
439
448
|
return;
|
|
440
449
|
}
|
|
450
|
+
if (argv[0] === "modify-order-address" ) {
|
|
451
|
+
await modifyOrderAddress(argv[1]);
|
|
452
|
+
return;
|
|
453
|
+
}
|
|
441
454
|
printHelp();
|
|
442
455
|
}
|
|
443
456
|
|
package/package.json
CHANGED