eprolo-cli 1.0.71 → 1.0.72
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 +14 -0
- package/package.json +1 -1
package/bin/eprolo-cli.js
CHANGED
|
@@ -206,6 +206,16 @@ async function queryOrders(orderId) {
|
|
|
206
206
|
console.log(JSON.stringify(data, null, 2));
|
|
207
207
|
process.exit(0);
|
|
208
208
|
}
|
|
209
|
+
async function queryOrderList() {
|
|
210
|
+
const config = readConfig();
|
|
211
|
+
if (!config.accessToken) {
|
|
212
|
+
console.error(JSON.stringify({ success: false, errorMessage: "未授权,请先登录" }));
|
|
213
|
+
process.exit(1);
|
|
214
|
+
}
|
|
215
|
+
const data = await postJsonWithRetry(ORDERS_API, {timestamp:config.timestamp,sign:config.accessToken}, config, "GET");
|
|
216
|
+
console.log(JSON.stringify(data, null, 2));
|
|
217
|
+
process.exit(0);
|
|
218
|
+
}
|
|
209
219
|
|
|
210
220
|
// ---------------------------------------------------------------------------
|
|
211
221
|
// help
|
|
@@ -269,6 +279,10 @@ async function main() {
|
|
|
269
279
|
await queryOrders(argv[2]);
|
|
270
280
|
return;
|
|
271
281
|
}
|
|
282
|
+
if (argv[0] === "list") {
|
|
283
|
+
await queryOrderList();
|
|
284
|
+
return;
|
|
285
|
+
}
|
|
272
286
|
|
|
273
287
|
printHelp();
|
|
274
288
|
}
|
package/package.json
CHANGED