eprolo-cli 1.0.110 → 1.0.112

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 CHANGED
@@ -9,9 +9,6 @@ const http = require("http");
9
9
  const LOGIN_API = "https://wixtest.eprolo.com/v1/auth/verifyCode.stm";
10
10
  const BASE_URL = "https://wixtest.eprolo.com";
11
11
  const REFRESH_API = "https://wixtest.eprolo.com/v1/auth/refresh-code";
12
- const ORDERS_API = "https://wixtest.eprolo.com/order_list.html";
13
- const PRODUCT_TYPE_API = "https://wixtest.eprolo.com/getproduct.html";
14
- const PRODUCT_LIST_API = "https://wixtest.eprolo.com/product_list.html";
15
12
  const CONFIG_DIR = path.join(os.homedir(), ".eprolo-toolkit");
16
13
  const CONFIG_FILE = path.join(CONFIG_DIR, "config.json");
17
14
 
@@ -192,13 +189,13 @@ async function queryOrders(orderId) {
192
189
  console.error(JSON.stringify({ success: false, errorMessage: "缺少订单 ID" }));
193
190
  process.exit(1);
194
191
  }
195
- const data = await postJsonWithRetry(ORDERS_API, {}, config, "GET");
192
+ const data = await postJsonWithRetry(BASE_URL+"/order.html?page_index=0&page_size=1&order_id="+orderId, {}, config, "GET");
196
193
  console.log(JSON.stringify(data, null, 2));
197
194
  process.exit(0);
198
195
  }
199
196
  async function queryOrderList() {
200
197
  const config = readConfig();
201
- const data = await postJsonWithRetry(ORDERS_API, {}, config, "GET");
198
+ const data = await postJsonWithRetry(BASE_URL+"/order_list.html?page_index=0&page_size=10", {}, config, "GET");
202
199
  console.log(JSON.stringify(data, null, 2));
203
200
  process.exit(0);
204
201
  }
@@ -208,13 +205,13 @@ async function queryProductId(productId) {
208
205
  console.error(JSON.stringify({ success: false, errorMessage: "缺少产品 ID" }));
209
206
  process.exit(1);
210
207
  }
211
- const data = await postJsonWithRetry(PRODUCT_TYPE_API, { id: productId }, config, "GET");
208
+ const data = await postJsonWithRetry(BASE_URL+"/getproduct.html?id="+productId, {}, config, "GET");
212
209
  console.log(JSON.stringify(data, null, 2));
213
210
  process.exit(0);
214
211
  }
215
212
  async function queryProductList() {
216
213
  const config = readConfig();
217
- const data = await postJsonWithRetry(PRODUCT_LIST_API, {}, config, "GET");
214
+ const data = await postJsonWithRetry(BASE_URL+"/product_list.html?page_index=0&page_size=10", {}, config, "GET");
218
215
  console.log(JSON.stringify(data, null, 2));
219
216
  process.exit(0);
220
217
  }
@@ -286,7 +283,7 @@ async function insertProduct(arg) {
286
283
  process.exit(0);
287
284
  }
288
285
  } else {
289
- console.log(JSON.stringify(data, null, 2));
286
+ console.log(data);
290
287
  process.exit(0);
291
288
  }
292
289
  }
@@ -338,7 +335,7 @@ async function addOrder(arg) {
338
335
  console.log("-------222----------", newOrder);
339
336
  // const data = await postJsonWithRetry(`http://43.153.35.208:3000/addInfo`, newOrder, config, "POST");
340
337
  const data = await postJsonWithRetry(BASE_URL + '/add_order.html', newOrder, config, "POST");
341
- console.log(JSON.stringify(data, null, 2));
338
+ console.log(data);
342
339
  process.exit(0);
343
340
  }
344
341
  // ---------------------------------------------------------------------------
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eprolo-cli",
3
- "version": "1.0.110",
3
+ "version": "1.0.112",
4
4
  "description": "CLI for Dianxiaobao ICBU AI publishing, authorization profile management, task submission, and task status checks.",
5
5
  "bin": {
6
6
  "eprolo": "bin/eprolo-cli.js"