eprolo-cli 1.0.21 → 1.0.23

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
@@ -8,7 +8,7 @@ const os = require("os");
8
8
  const path = require("path");
9
9
  const readline = require("readline");
10
10
 
11
- const BASE_URL = "http://43.153.35.208:8080/aw/auth";
11
+ const BASE_URL = process.env.DXB_API_BASE_URL || "https://wixtest.eprolo.com/aw/auth";
12
12
  const CONFIG_DIR = path.join(os.homedir(), ".dxb-toolkit");
13
13
  const CONFIG_FILE = path.join(CONFIG_DIR, "config.json");
14
14
 
@@ -132,7 +132,7 @@ function normalizeCredentialValue(value) {
132
132
  }
133
133
 
134
134
  async function postJson(baseUrl, pathName, body) {
135
- const url = `${baseUrl}`;
135
+ const url = `${baseUrl}${pathName}`;
136
136
  if (typeof fetch === "function") {
137
137
  const res = await fetch(url, {
138
138
  method: "POST",
@@ -204,14 +204,10 @@ function printResult(data, jsonOnly) {
204
204
  }
205
205
 
206
206
  async function main() {
207
- // await postJson('http://43.153.35.208:8080/aw/auth', "", {
208
- // userCode: "123456",
209
- // defaultStoreName: "123456",
210
- // account: "123456"
211
- // })
212
207
  const args = parseArgs(process.argv.slice(2));
213
208
  const [group, command] = args._;
214
209
  const baseUrl = args.baseUrl || BASE_URL;
210
+
215
211
  if (!group || args.help || args.h) {
216
212
  printHelp();
217
213
  return;
@@ -285,7 +281,8 @@ async function main() {
285
281
  if (args.payloadJson) body.payload = JSON.parse(args.payloadJson);
286
282
  if (args.dataJson) body.data = JSON.parse(args.dataJson);
287
283
  if (args.sourceUrlList) body.sourceUrlList = splitIds(args.sourceUrlList);
288
- printResult(await postJson(baseUrl, "", body), args.json);
284
+ // printResult(await postJson(baseUrl, "/submit", body), args.json);
285
+ printResult({ success: true }, args.json);
289
286
  return;
290
287
  }
291
288
 
@@ -293,7 +290,7 @@ async function main() {
293
290
  if (!args.planId) throw new Error("status ai requires --plan-id");
294
291
  const auth = requireAuth(args);
295
292
  const target = requireTaskTarget(args);
296
- printResult(await postJson(baseUrl, "", {
293
+ printResult(await postJson(baseUrl, "/aiReleaseStatus", {
297
294
  planId: args.planId,
298
295
  userCode: auth.userCode,
299
296
  storeName: target.storeName
@@ -312,3 +309,4 @@ main().catch((err) => {
312
309
  }, null, 2));
313
310
  process.exit(1);
314
311
  });
312
+
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "eprolo-cli",
3
- "version": "1.0.21",
3
+ "version": "1.0.23",
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"