eprolo-cli 1.0.76 → 1.0.77
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 -1
- package/package.json +1 -1
package/bin/eprolo-cli.js
CHANGED
|
@@ -10,6 +10,7 @@ const LOGIN_API = "https://wixtest.eprolo.com/v1/auth/verifyCode.stm";
|
|
|
10
10
|
const REFRESH_API = "https://wixtest.eprolo.com/v1/auth/refresh-code";
|
|
11
11
|
const ORDERS_API = "https://wixtest.eprolo.com/order_list.html";
|
|
12
12
|
const PRODUCT_TYPE_API = "https://wixtest.eprolo.com/getproduct.html";
|
|
13
|
+
const PRODUCT_LIST_API = "https://wixtest.eprolo.com/product_list.html";
|
|
13
14
|
const CONFIG_DIR = path.join(os.homedir(), ".eprolo-toolkit");
|
|
14
15
|
const CONFIG_FILE = path.join(CONFIG_DIR, "config.json");
|
|
15
16
|
|
|
@@ -222,6 +223,12 @@ async function queryProductId(productId) {
|
|
|
222
223
|
console.log(JSON.stringify(data, null, 2));
|
|
223
224
|
process.exit(0);
|
|
224
225
|
}
|
|
226
|
+
async function queryProductList() {
|
|
227
|
+
const config = readConfig();
|
|
228
|
+
const data = await postJsonWithRetry(PRODUCT_LIST_API, {}, config, "GET");
|
|
229
|
+
console.log(JSON.stringify(data, null, 2));
|
|
230
|
+
process.exit(0);
|
|
231
|
+
}
|
|
225
232
|
// ---------------------------------------------------------------------------
|
|
226
233
|
// help
|
|
227
234
|
// ---------------------------------------------------------------------------
|
|
@@ -292,7 +299,10 @@ async function main() {
|
|
|
292
299
|
await queryProductId(argv[1]);
|
|
293
300
|
return;
|
|
294
301
|
}
|
|
295
|
-
|
|
302
|
+
if (argv[0] === "product-list") {
|
|
303
|
+
await queryProductList();
|
|
304
|
+
return;
|
|
305
|
+
}
|
|
296
306
|
printHelp();
|
|
297
307
|
}
|
|
298
308
|
|
package/package.json
CHANGED