connect-api-cli 1.1.3 → 1.1.4
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/README.md +13 -5
- package/dist/cli.js +296 -225
- package/dist/index.js +49 -21
- package/dist/index.mjs +1203 -10
- package/package.json +7 -6
- package/dist/chunk-3WGV37EN.mjs +0 -1187
- package/dist/chunk-3WGV37EN.mjs.map +0 -1
- package/dist/cli.d.mts +0 -1
- package/dist/cli.d.ts +0 -1
- package/dist/cli.js.map +0 -1
- package/dist/cli.mjs +0 -1711
- package/dist/cli.mjs.map +0 -1
- package/dist/index.js.map +0 -1
- package/dist/index.mjs.map +0 -1
package/dist/cli.js
CHANGED
|
@@ -23,11 +23,51 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
23
23
|
mod
|
|
24
24
|
));
|
|
25
25
|
|
|
26
|
+
// src/cli/output.ts
|
|
27
|
+
function reportFailure(...messages) {
|
|
28
|
+
console.error(...messages);
|
|
29
|
+
process.exitCode = 1;
|
|
30
|
+
}
|
|
31
|
+
function printResult(result) {
|
|
32
|
+
console.log(JSON.stringify(result, null, 2));
|
|
33
|
+
if (!result || typeof result !== "object") return;
|
|
34
|
+
const response = result;
|
|
35
|
+
const code = response.ret?.code ?? response.rtnCode;
|
|
36
|
+
if (code !== void 0 && code !== 0 && code !== "0") {
|
|
37
|
+
reportFailure(`API request failed (code=${String(code)})`);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
|
|
26
41
|
// src/cli/index.ts
|
|
27
42
|
var import_commander = require("commander");
|
|
28
|
-
var
|
|
43
|
+
var fs8 = __toESM(require("fs"));
|
|
29
44
|
var import_path6 = __toESM(require("path"));
|
|
30
45
|
|
|
46
|
+
// src/core/private-file.ts
|
|
47
|
+
var import_fs = __toESM(require("fs"));
|
|
48
|
+
function restrictPermissions(fd) {
|
|
49
|
+
if (process.platform !== "win32") import_fs.default.fchmodSync(fd, 384);
|
|
50
|
+
}
|
|
51
|
+
function readPrivateFile(file) {
|
|
52
|
+
const fd = import_fs.default.openSync(file, "r");
|
|
53
|
+
try {
|
|
54
|
+
restrictPermissions(fd);
|
|
55
|
+
return import_fs.default.readFileSync(fd, "utf8");
|
|
56
|
+
} finally {
|
|
57
|
+
import_fs.default.closeSync(fd);
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
function writePrivateFile(file, contents) {
|
|
61
|
+
const fd = import_fs.default.openSync(file, import_fs.default.constants.O_WRONLY | import_fs.default.constants.O_CREAT, 384);
|
|
62
|
+
try {
|
|
63
|
+
restrictPermissions(fd);
|
|
64
|
+
import_fs.default.ftruncateSync(fd, 0);
|
|
65
|
+
import_fs.default.writeFileSync(fd, contents, "utf8");
|
|
66
|
+
} finally {
|
|
67
|
+
import_fs.default.closeSync(fd);
|
|
68
|
+
}
|
|
69
|
+
}
|
|
70
|
+
|
|
31
71
|
// src/services/auth.ts
|
|
32
72
|
var import_axios = __toESM(require("axios"));
|
|
33
73
|
var crypto = __toESM(require("crypto"));
|
|
@@ -35,9 +75,9 @@ var crypto = __toESM(require("crypto"));
|
|
|
35
75
|
// src/config/index.ts
|
|
36
76
|
var dotenv = __toESM(require("dotenv"));
|
|
37
77
|
var import_path = __toESM(require("path"));
|
|
38
|
-
var
|
|
78
|
+
var import_fs2 = __toESM(require("fs"));
|
|
39
79
|
var envPath = import_path.default.resolve(process.cwd(), ".env");
|
|
40
|
-
if (
|
|
80
|
+
if (import_fs2.default.existsSync(envPath)) {
|
|
41
81
|
dotenv.config({ path: envPath, quiet: true });
|
|
42
82
|
} else {
|
|
43
83
|
dotenv.config({ quiet: true });
|
|
@@ -52,12 +92,12 @@ var DEFAULT_OAUTH = {
|
|
|
52
92
|
};
|
|
53
93
|
function loadServiceAccountCredentials(filePath) {
|
|
54
94
|
const abs = import_path.default.isAbsolute(filePath) ? filePath : import_path.default.resolve(process.cwd(), filePath);
|
|
55
|
-
if (!
|
|
95
|
+
if (!import_fs2.default.existsSync(abs)) {
|
|
56
96
|
throw new Error(`Service Account credentials file not found: ${abs}`);
|
|
57
97
|
}
|
|
58
98
|
let raw;
|
|
59
99
|
try {
|
|
60
|
-
raw = JSON.parse(
|
|
100
|
+
raw = JSON.parse(import_fs2.default.readFileSync(abs, "utf8"));
|
|
61
101
|
} catch {
|
|
62
102
|
throw new Error(`Invalid Service Account credentials JSON: ${abs}`);
|
|
63
103
|
}
|
|
@@ -134,6 +174,7 @@ var AuthService = class {
|
|
|
134
174
|
client_secret: config2.clientSecret
|
|
135
175
|
};
|
|
136
176
|
const response = await import_axios.default.post(url, payload, {
|
|
177
|
+
maxRedirects: 0,
|
|
137
178
|
headers: {
|
|
138
179
|
"Content-Type": "application/json"
|
|
139
180
|
}
|
|
@@ -199,6 +240,7 @@ var AuthService = class {
|
|
|
199
240
|
const timeoutId = setTimeout(() => controller.abort(), 3e4);
|
|
200
241
|
try {
|
|
201
242
|
const res = await import_axios.default.post(cfg.oauth.tokenUrl, { code, redirectUri }, {
|
|
243
|
+
maxRedirects: 0,
|
|
202
244
|
headers: { "Content-Type": "application/json" },
|
|
203
245
|
signal: controller.signal
|
|
204
246
|
});
|
|
@@ -225,6 +267,7 @@ var AuthService = class {
|
|
|
225
267
|
const timeoutId = setTimeout(() => controller.abort(), 3e4);
|
|
226
268
|
try {
|
|
227
269
|
const res = await import_axios.default.post(cfg.oauth.refreshUrl, { refreshToken }, {
|
|
270
|
+
maxRedirects: 0,
|
|
228
271
|
headers: { "Content-Type": "application/json" },
|
|
229
272
|
signal: controller.signal
|
|
230
273
|
});
|
|
@@ -255,15 +298,15 @@ function normalizePem(privateKey) {
|
|
|
255
298
|
|
|
256
299
|
// src/core/oauth-team.ts
|
|
257
300
|
var import_axios2 = __toESM(require("axios"));
|
|
258
|
-
var
|
|
301
|
+
var import_fs3 = __toESM(require("fs"));
|
|
259
302
|
var import_path2 = __toESM(require("path"));
|
|
260
303
|
var import_os = __toESM(require("os"));
|
|
261
304
|
var TOKEN_FILE = import_path2.default.join(import_os.default.homedir(), ".connect-api-cli-token.json");
|
|
262
305
|
var cachedTeamId;
|
|
263
306
|
function readPersistedTeamId() {
|
|
264
307
|
try {
|
|
265
|
-
if (!
|
|
266
|
-
const data = JSON.parse(
|
|
308
|
+
if (!import_fs3.default.existsSync(TOKEN_FILE)) return void 0;
|
|
309
|
+
const data = JSON.parse(readPrivateFile(TOKEN_FILE));
|
|
267
310
|
return data.teamId || void 0;
|
|
268
311
|
} catch {
|
|
269
312
|
return void 0;
|
|
@@ -271,10 +314,10 @@ function readPersistedTeamId() {
|
|
|
271
314
|
}
|
|
272
315
|
function writePersistedTeamId(teamId) {
|
|
273
316
|
try {
|
|
274
|
-
if (!
|
|
275
|
-
const data = JSON.parse(
|
|
317
|
+
if (!import_fs3.default.existsSync(TOKEN_FILE)) return;
|
|
318
|
+
const data = JSON.parse(readPrivateFile(TOKEN_FILE));
|
|
276
319
|
data.teamId = teamId;
|
|
277
|
-
|
|
320
|
+
writePrivateFile(TOKEN_FILE, JSON.stringify(data, null, 2));
|
|
278
321
|
} catch {
|
|
279
322
|
}
|
|
280
323
|
}
|
|
@@ -297,7 +340,8 @@ async function resolveOAuthTeamId(cfg, accessToken) {
|
|
|
297
340
|
oauth2Token: accessToken,
|
|
298
341
|
"Content-Type": "application/json"
|
|
299
342
|
},
|
|
300
|
-
timeout: 3e4
|
|
343
|
+
timeout: 3e4,
|
|
344
|
+
maxRedirects: 0
|
|
301
345
|
}
|
|
302
346
|
);
|
|
303
347
|
const teams = res.data.teams || [];
|
|
@@ -333,7 +377,7 @@ function clearOAuthTeamIdCache() {
|
|
|
333
377
|
var crypto2 = __toESM(require("crypto"));
|
|
334
378
|
var http = __toESM(require("http"));
|
|
335
379
|
var import_child_process = require("child_process");
|
|
336
|
-
var
|
|
380
|
+
var import_fs4 = __toESM(require("fs"));
|
|
337
381
|
var import_path3 = __toESM(require("path"));
|
|
338
382
|
var import_os2 = __toESM(require("os"));
|
|
339
383
|
var AuthManager = class {
|
|
@@ -464,8 +508,8 @@ var AuthManager = class {
|
|
|
464
508
|
}
|
|
465
509
|
static readCache() {
|
|
466
510
|
try {
|
|
467
|
-
if (
|
|
468
|
-
const data =
|
|
511
|
+
if (import_fs4.default.existsSync(this.cacheFile)) {
|
|
512
|
+
const data = readPrivateFile(this.cacheFile);
|
|
469
513
|
return JSON.parse(data);
|
|
470
514
|
}
|
|
471
515
|
} catch (e) {
|
|
@@ -474,7 +518,7 @@ var AuthManager = class {
|
|
|
474
518
|
}
|
|
475
519
|
static writeCache(cache) {
|
|
476
520
|
try {
|
|
477
|
-
|
|
521
|
+
writePrivateFile(this.cacheFile, JSON.stringify(cache, null, 2));
|
|
478
522
|
} catch (e) {
|
|
479
523
|
}
|
|
480
524
|
}
|
|
@@ -484,8 +528,8 @@ var AuthManager = class {
|
|
|
484
528
|
static clearCache() {
|
|
485
529
|
clearOAuthTeamIdCache();
|
|
486
530
|
try {
|
|
487
|
-
if (
|
|
488
|
-
|
|
531
|
+
if (import_fs4.default.existsSync(this.cacheFile)) {
|
|
532
|
+
import_fs4.default.unlinkSync(this.cacheFile);
|
|
489
533
|
return true;
|
|
490
534
|
}
|
|
491
535
|
return false;
|
|
@@ -506,7 +550,7 @@ function openBrowser(url) {
|
|
|
506
550
|
|
|
507
551
|
// src/core/http.ts
|
|
508
552
|
var import_axios3 = __toESM(require("axios"));
|
|
509
|
-
var agcClient = import_axios3.default.create();
|
|
553
|
+
var agcClient = import_axios3.default.create({ maxRedirects: 0 });
|
|
510
554
|
function setHeader(headers, name, value) {
|
|
511
555
|
if (typeof headers?.set === "function") {
|
|
512
556
|
headers.set(name, value);
|
|
@@ -1051,7 +1095,7 @@ var ProvisionService = class {
|
|
|
1051
1095
|
|
|
1052
1096
|
// src/services/upload.ts
|
|
1053
1097
|
var import_axios4 = __toESM(require("axios"));
|
|
1054
|
-
var
|
|
1098
|
+
var import_fs5 = __toESM(require("fs"));
|
|
1055
1099
|
var import_path4 = __toESM(require("path"));
|
|
1056
1100
|
function pickObjectId(res) {
|
|
1057
1101
|
return res.urlInfo?.objectId || res.objectId;
|
|
@@ -1091,7 +1135,7 @@ var UploadService = class {
|
|
|
1091
1135
|
* 仅完成 OBS 落盘;HarmonyOS `.app` 还须调用更新应用软件包信息,AGC 控制台才会有记录。
|
|
1092
1136
|
*/
|
|
1093
1137
|
static async uploadFile(options) {
|
|
1094
|
-
const stat =
|
|
1138
|
+
const stat = import_fs5.default.statSync(options.filePath);
|
|
1095
1139
|
const fileName = import_path4.default.basename(options.filePath) || "unknown";
|
|
1096
1140
|
if (stat.size < 5 * 1024 * 1024) {
|
|
1097
1141
|
return this.uploadSingleFile(options, fileName, stat.size);
|
|
@@ -1133,7 +1177,7 @@ var UploadService = class {
|
|
|
1133
1177
|
);
|
|
1134
1178
|
}
|
|
1135
1179
|
const { url, headers } = urlRes.urlInfo;
|
|
1136
|
-
const fileStream =
|
|
1180
|
+
const fileStream = import_fs5.default.createReadStream(options.filePath);
|
|
1137
1181
|
await import_axios4.default.put(url, fileStream, {
|
|
1138
1182
|
headers: this.buildObsPutHeaders(headers, contentLength),
|
|
1139
1183
|
maxBodyLength: Infinity,
|
|
@@ -1174,7 +1218,7 @@ var UploadService = class {
|
|
|
1174
1218
|
if (!uploadInfoMap) {
|
|
1175
1219
|
throw new Error(`Failed to get parts upload URL: ${JSON.stringify(partsRes.ret)}`);
|
|
1176
1220
|
}
|
|
1177
|
-
const fd =
|
|
1221
|
+
const fd = import_fs5.default.openSync(options.filePath, "r");
|
|
1178
1222
|
const composeReqBody = {};
|
|
1179
1223
|
for (let i = 1; i <= partsCount; i++) {
|
|
1180
1224
|
const propKey = `additionalProp${i}`;
|
|
@@ -1183,7 +1227,7 @@ var UploadService = class {
|
|
|
1183
1227
|
const end = Math.min(start + partSize, fileSize);
|
|
1184
1228
|
const length = end - start;
|
|
1185
1229
|
const buffer = Buffer.alloc(length);
|
|
1186
|
-
|
|
1230
|
+
import_fs5.default.readSync(fd, buffer, 0, length, start);
|
|
1187
1231
|
const res = await import_axios4.default.put(uploadInfo.url, buffer, {
|
|
1188
1232
|
headers: this.buildObsPutHeaders(uploadInfo.headers, length),
|
|
1189
1233
|
maxBodyLength: Infinity,
|
|
@@ -1195,7 +1239,7 @@ var UploadService = class {
|
|
|
1195
1239
|
etag
|
|
1196
1240
|
};
|
|
1197
1241
|
}
|
|
1198
|
-
|
|
1242
|
+
import_fs5.default.closeSync(fd);
|
|
1199
1243
|
await this.composeMultipart({
|
|
1200
1244
|
objectId,
|
|
1201
1245
|
nspUploadId,
|
|
@@ -1206,7 +1250,7 @@ var UploadService = class {
|
|
|
1206
1250
|
};
|
|
1207
1251
|
|
|
1208
1252
|
// src/services/domain.ts
|
|
1209
|
-
var
|
|
1253
|
+
var import_fs6 = __toESM(require("fs"));
|
|
1210
1254
|
var DomainService = class {
|
|
1211
1255
|
/**
|
|
1212
1256
|
* 查询元服务的域名配置信息
|
|
@@ -1259,7 +1303,7 @@ var DomainService = class {
|
|
|
1259
1303
|
}
|
|
1260
1304
|
);
|
|
1261
1305
|
return new Promise((resolve, reject) => {
|
|
1262
|
-
const writer =
|
|
1306
|
+
const writer = import_fs6.default.createWriteStream(outputPath);
|
|
1263
1307
|
response.data.pipe(writer);
|
|
1264
1308
|
let error = null;
|
|
1265
1309
|
writer.on("error", (err) => {
|
|
@@ -1290,7 +1334,7 @@ var DomainService = class {
|
|
|
1290
1334
|
};
|
|
1291
1335
|
|
|
1292
1336
|
// src/services/sign.ts
|
|
1293
|
-
var
|
|
1337
|
+
var import_fs7 = __toESM(require("fs"));
|
|
1294
1338
|
var import_path5 = __toESM(require("path"));
|
|
1295
1339
|
var import_child_process2 = require("child_process");
|
|
1296
1340
|
var import_crypto = __toESM(require("crypto"));
|
|
@@ -1311,22 +1355,47 @@ var SignService = class {
|
|
|
1311
1355
|
filename: signId
|
|
1312
1356
|
};
|
|
1313
1357
|
}
|
|
1358
|
+
/** hap-sign-tool.jar 相对 SDK 根的位置 */
|
|
1359
|
+
static HAP_SIGN_TOOL_REL = ["default", "openharmony", "toolchains", "lib", "hap-sign-tool.jar"];
|
|
1360
|
+
/**
|
|
1361
|
+
* 只根据调用方给出的路径解析 SDK:`--sdk-path` → `DEVECO_HOME` 下的 `sdk/` 或 `Contents/sdk/`。
|
|
1362
|
+
* 不扫盘、不猜常见安装目录。
|
|
1363
|
+
*/
|
|
1364
|
+
static resolveHarmonySdkPath(explicit) {
|
|
1365
|
+
if (explicit) return explicit;
|
|
1366
|
+
return this.sdkPathFromDevEcoHome(process.env.DEVECO_HOME);
|
|
1367
|
+
}
|
|
1368
|
+
/** 仅检查 `DEVECO_HOME` 本身及其 `Contents/`,找不到就返回 undefined */
|
|
1369
|
+
static sdkPathFromDevEcoHome(home) {
|
|
1370
|
+
if (!home) return void 0;
|
|
1371
|
+
for (const sdk of [import_path5.default.join(home, "sdk"), import_path5.default.join(home, "Contents", "sdk")]) {
|
|
1372
|
+
if (import_fs7.default.existsSync(import_path5.default.join(sdk, ...this.HAP_SIGN_TOOL_REL))) return sdk;
|
|
1373
|
+
}
|
|
1374
|
+
return void 0;
|
|
1375
|
+
}
|
|
1314
1376
|
static async createSignP12AndCsr(options) {
|
|
1315
1377
|
const javaPath = options.javaPath || "java";
|
|
1316
|
-
const sdkPath = options.sdkPath
|
|
1378
|
+
const sdkPath = this.resolveHarmonySdkPath(options.sdkPath);
|
|
1317
1379
|
if (!sdkPath) {
|
|
1318
|
-
|
|
1380
|
+
if (process.env.DEVECO_HOME) {
|
|
1381
|
+
throw new Error(
|
|
1382
|
+
"DEVECO_HOME is set but HarmonyOS SDK was not found under it (expected sdk/ or Contents/sdk/). Ask the user to correct the DevEco Studio path; do not search the disk."
|
|
1383
|
+
);
|
|
1384
|
+
}
|
|
1385
|
+
throw new Error(
|
|
1386
|
+
"sdkPath is required. Provide it via --sdk-path or DEVECO_HOME in .env."
|
|
1387
|
+
);
|
|
1319
1388
|
}
|
|
1320
1389
|
const signToolPath = import_path5.default.join(sdkPath, "default", "openharmony", "toolchains", "lib", "hap-sign-tool.jar");
|
|
1321
|
-
if (!
|
|
1390
|
+
if (!import_fs7.default.existsSync(signToolPath)) {
|
|
1322
1391
|
throw new Error(`hap-sign-tool.jar not found at ${signToolPath}`);
|
|
1323
1392
|
}
|
|
1324
1393
|
const { rootDir, bundleDir, filename } = this.resolveSignOutputLayout(options);
|
|
1325
|
-
const createdBundleDir = !
|
|
1326
|
-
if (!
|
|
1327
|
-
|
|
1394
|
+
const createdBundleDir = !import_fs7.default.existsSync(bundleDir);
|
|
1395
|
+
if (!import_fs7.default.existsSync(rootDir)) {
|
|
1396
|
+
import_fs7.default.mkdirSync(rootDir, { recursive: true });
|
|
1328
1397
|
}
|
|
1329
|
-
|
|
1398
|
+
import_fs7.default.mkdirSync(bundleDir, { recursive: true });
|
|
1330
1399
|
const p12FilePath = import_path5.default.join(bundleDir, this.signFileName(filename, "p12"));
|
|
1331
1400
|
const csrFilePath = import_path5.default.join(bundleDir, this.signFileName(filename, "csr"));
|
|
1332
1401
|
const alias = options.alias;
|
|
@@ -1334,7 +1403,7 @@ var SignService = class {
|
|
|
1334
1403
|
try {
|
|
1335
1404
|
this.doCreateSignFileP12(javaPath, signToolPath, alias, pwd, p12FilePath);
|
|
1336
1405
|
this.doCreateSignFileCsr(javaPath, signToolPath, alias, pwd, p12FilePath, csrFilePath);
|
|
1337
|
-
const csrContent =
|
|
1406
|
+
const csrContent = import_fs7.default.readFileSync(csrFilePath, "utf8");
|
|
1338
1407
|
const materialPath = this.placeMaterialBesideStore(bundleDir);
|
|
1339
1408
|
return {
|
|
1340
1409
|
alias,
|
|
@@ -1350,7 +1419,7 @@ var SignService = class {
|
|
|
1350
1419
|
};
|
|
1351
1420
|
} catch (err) {
|
|
1352
1421
|
if (createdBundleDir) {
|
|
1353
|
-
|
|
1422
|
+
import_fs7.default.rmSync(bundleDir, { recursive: true, force: true });
|
|
1354
1423
|
}
|
|
1355
1424
|
throw err;
|
|
1356
1425
|
}
|
|
@@ -1373,18 +1442,18 @@ var SignService = class {
|
|
|
1373
1442
|
*/
|
|
1374
1443
|
static placeMaterialBesideStore(bundleDir, configDir) {
|
|
1375
1444
|
const dest = import_path5.default.join(bundleDir, "material");
|
|
1376
|
-
if (
|
|
1445
|
+
if (import_fs7.default.existsSync(dest)) {
|
|
1377
1446
|
return dest;
|
|
1378
1447
|
}
|
|
1379
1448
|
const home = process.env.HOME || process.env.USERPROFILE || "";
|
|
1380
1449
|
const src = import_path5.default.resolve(configDir || import_path5.default.join(home, ".ohos", "config"), "material");
|
|
1381
|
-
if (!
|
|
1450
|
+
if (!import_fs7.default.existsSync(src)) {
|
|
1382
1451
|
return void 0;
|
|
1383
1452
|
}
|
|
1384
1453
|
try {
|
|
1385
|
-
|
|
1454
|
+
import_fs7.default.symlinkSync(src, dest, process.platform === "win32" ? "junction" : "dir");
|
|
1386
1455
|
} catch {
|
|
1387
|
-
|
|
1456
|
+
import_fs7.default.cpSync(src, dest, { recursive: true });
|
|
1388
1457
|
}
|
|
1389
1458
|
return dest;
|
|
1390
1459
|
}
|
|
@@ -1446,12 +1515,12 @@ var SignService = class {
|
|
|
1446
1515
|
}
|
|
1447
1516
|
static COMPONENT = new Int8Array([49, 243, 9, 115, 214, 175, 91, 184, 211, 190, 177, 88, 101, 131, 192, 119]);
|
|
1448
1517
|
static readDirBytes(dirPath) {
|
|
1449
|
-
const entries =
|
|
1450
|
-
return new Int8Array(
|
|
1518
|
+
const entries = import_fs7.default.readdirSync(dirPath).filter((f) => f !== ".DS_Store");
|
|
1519
|
+
return new Int8Array(import_fs7.default.readFileSync(import_path5.default.resolve(dirPath, entries[0])));
|
|
1451
1520
|
}
|
|
1452
1521
|
static readFd(materialPath) {
|
|
1453
1522
|
const fdDir = import_path5.default.resolve(materialPath, "fd");
|
|
1454
|
-
return
|
|
1523
|
+
return import_fs7.default.readdirSync(fdDir).filter((f) => f !== ".DS_Store").map((e) => this.readDirBytes(import_path5.default.resolve(fdDir, e)));
|
|
1455
1524
|
}
|
|
1456
1525
|
static xorBuffers(a, b) {
|
|
1457
1526
|
const result = new Int8Array(a.byteLength);
|
|
@@ -1496,7 +1565,7 @@ var SignService = class {
|
|
|
1496
1565
|
*/
|
|
1497
1566
|
static encryptPassword(password, configDir) {
|
|
1498
1567
|
const dir = configDir || import_path5.default.join(process.env.HOME || "", ".ohos", "config");
|
|
1499
|
-
if (!
|
|
1568
|
+
if (!import_fs7.default.existsSync(import_path5.default.resolve(dir, "material"))) {
|
|
1500
1569
|
throw new Error(`\u672A\u627E\u5230\u52A0\u5BC6\u5BC6\u94A5\u76EE\u5F55: ${import_path5.default.resolve(dir, "material")}\u3002\u8BF7\u786E\u8BA4 DevEco Studio \u5DF2\u5B89\u88C5\u5E76\u751F\u6210\u8FC7\u7B7E\u540D\u914D\u7F6E\u3002`);
|
|
1501
1570
|
}
|
|
1502
1571
|
const key = this.deriveEncryptionKey(dir);
|
|
@@ -1845,12 +1914,12 @@ function promptStderr(question) {
|
|
|
1845
1914
|
// src/cli/index.ts
|
|
1846
1915
|
var program = new import_commander.Command();
|
|
1847
1916
|
function readCliVersion() {
|
|
1848
|
-
if (
|
|
1849
|
-
return
|
|
1917
|
+
if ("1.1.4") {
|
|
1918
|
+
return "1.1.4";
|
|
1850
1919
|
}
|
|
1851
1920
|
try {
|
|
1852
1921
|
const pkgPath = import_path6.default.join(__dirname, "..", "package.json");
|
|
1853
|
-
const pkg = JSON.parse(
|
|
1922
|
+
const pkg = JSON.parse(fs8.readFileSync(pkgPath, "utf8"));
|
|
1854
1923
|
if (pkg.version) return pkg.version;
|
|
1855
1924
|
} catch {
|
|
1856
1925
|
}
|
|
@@ -1864,7 +1933,7 @@ authCmd.command("login").description("Login and cache token (client_credentials
|
|
|
1864
1933
|
console.log("Successfully logged in. Token generated and cached.");
|
|
1865
1934
|
console.log(`Token snippet: ${token.substring(0, 10)}...`);
|
|
1866
1935
|
} catch (e) {
|
|
1867
|
-
|
|
1936
|
+
reportFailure("Login failed:", e.message);
|
|
1868
1937
|
}
|
|
1869
1938
|
});
|
|
1870
1939
|
authCmd.command("status").description("Show current auth mode and cached token status").action(() => {
|
|
@@ -1872,7 +1941,7 @@ authCmd.command("status").description("Show current auth mode and cached token s
|
|
|
1872
1941
|
try {
|
|
1873
1942
|
cfg = getConfig();
|
|
1874
1943
|
} catch (e) {
|
|
1875
|
-
|
|
1944
|
+
reportFailure(`Auth status unavailable: ${e.message}`);
|
|
1876
1945
|
process.exitCode = 1;
|
|
1877
1946
|
return;
|
|
1878
1947
|
}
|
|
@@ -1910,14 +1979,14 @@ authCmd.command("logout").description("Logout and clear cached access token").ac
|
|
|
1910
1979
|
});
|
|
1911
1980
|
var publishCmd = program.command("publish").description("Publishing API commands");
|
|
1912
1981
|
function readJsonFile(filePath) {
|
|
1913
|
-
return JSON.parse(
|
|
1982
|
+
return JSON.parse(fs8.readFileSync(filePath, "utf8"));
|
|
1914
1983
|
}
|
|
1915
1984
|
publishCmd.command("app-id").description("Get App ID by package name").requiredOption("-p, --package-name <packageName>", "Package name (comma-separated, max 50)").option("--package-types <packageTypes>", "Optional package types filter").action(async (options) => {
|
|
1916
1985
|
try {
|
|
1917
1986
|
const res = await PublishService.getAppIdList(options.packageName, options.packageTypes);
|
|
1918
|
-
|
|
1987
|
+
printResult(res);
|
|
1919
1988
|
} catch (e) {
|
|
1920
|
-
|
|
1989
|
+
reportFailure("Request failed:", e.message);
|
|
1921
1990
|
}
|
|
1922
1991
|
});
|
|
1923
1992
|
publishCmd.command("app-create").description("Create an app or meta-service (omit --project-id to pick from project list)").option("--project-id <projectId>", "AGC project ID (interactive pick if omitted)").requiredOption("--app-name <appName>", "App / meta-service name").option("-p, --package-name <packageName>", "Package name (required for app; omit for meta-service)").requiredOption(
|
|
@@ -1931,19 +2000,20 @@ publishCmd.command("app-create").description("Create an app or meta-service (omi
|
|
|
1931
2000
|
const parentType = Number(options.parentType);
|
|
1932
2001
|
const installationFree = Number(options.installationFree);
|
|
1933
2002
|
if (parentType !== 2 && parentType !== 13) {
|
|
1934
|
-
|
|
2003
|
+
reportFailure("Invalid --parent-type: must be 2 (game) or 13 (app)");
|
|
1935
2004
|
return;
|
|
1936
2005
|
}
|
|
1937
2006
|
if (installationFree !== 0 && installationFree !== 1) {
|
|
1938
|
-
|
|
2007
|
+
reportFailure("Invalid --installation-free: must be 0 (app) or 1 (meta-service)");
|
|
1939
2008
|
return;
|
|
1940
2009
|
}
|
|
1941
2010
|
if (installationFree === 0 && !options.packageName) {
|
|
1942
|
-
|
|
2011
|
+
reportFailure("Missing -p/--package-name: required when creating an app (installation-free=0)");
|
|
1943
2012
|
return;
|
|
1944
2013
|
}
|
|
1945
2014
|
const projectId = await resolveProjectId(options.projectId);
|
|
1946
2015
|
if (!projectId) {
|
|
2016
|
+
process.exitCode = 1;
|
|
1947
2017
|
return;
|
|
1948
2018
|
}
|
|
1949
2019
|
const res = await PublishService.createApp({
|
|
@@ -1953,9 +2023,9 @@ publishCmd.command("app-create").description("Create an app or meta-service (omi
|
|
|
1953
2023
|
parentType,
|
|
1954
2024
|
installationFree
|
|
1955
2025
|
});
|
|
1956
|
-
|
|
2026
|
+
printResult(res);
|
|
1957
2027
|
} catch (e) {
|
|
1958
|
-
|
|
2028
|
+
reportFailure("Request failed:", e.message);
|
|
1959
2029
|
}
|
|
1960
2030
|
});
|
|
1961
2031
|
publishCmd.command("members").description("List team members and roles").requiredOption("--from-page <fromPage>", "Start page (>=1)").requiredOption("--page-size <pageSize>", "Page size (1-50)").requiredOption("--lang <languageCode>", "Language code: zh_cn / en_us / ru_ru").action(async (options) => {
|
|
@@ -1965,9 +2035,9 @@ publishCmd.command("members").description("List team members and roles").require
|
|
|
1965
2035
|
pageSize: Number(options.pageSize),
|
|
1966
2036
|
languageCode: options.lang
|
|
1967
2037
|
});
|
|
1968
|
-
|
|
2038
|
+
printResult(res);
|
|
1969
2039
|
} catch (e) {
|
|
1970
|
-
|
|
2040
|
+
reportFailure("Request failed:", e.message);
|
|
1971
2041
|
}
|
|
1972
2042
|
});
|
|
1973
2043
|
publishCmd.command("app-info").description("Get App Info by App ID").requiredOption("-a, --app-id <appId>", "App ID").option("-l, --lang <lang>", "Language, e.g. zh-CN").option("-r, --release-type <releaseType>", "1 full, 6 HarmonyOS test").option("-v, --version-id <versionId>", "Version ID (required when releaseType=6)").action(async (options) => {
|
|
@@ -1978,9 +2048,9 @@ publishCmd.command("app-info").description("Get App Info by App ID").requiredOpt
|
|
|
1978
2048
|
releaseType: options.releaseType ? Number(options.releaseType) : void 0,
|
|
1979
2049
|
versionId: options.versionId
|
|
1980
2050
|
});
|
|
1981
|
-
|
|
2051
|
+
printResult(res);
|
|
1982
2052
|
} catch (e) {
|
|
1983
|
-
|
|
2053
|
+
reportFailure("Request failed:", e.message);
|
|
1984
2054
|
}
|
|
1985
2055
|
});
|
|
1986
2056
|
publishCmd.command("app-info-update").description("Update app basic info").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("--body <bodyFile>", "JSON body of app basic fields").option("-r, --release-type <releaseType>", "Release type").option("--release-phase <releasePhase>", "Release phase").action(async (options) => {
|
|
@@ -1992,9 +2062,9 @@ publishCmd.command("app-info-update").description("Update app basic info").requi
|
|
|
1992
2062
|
releasePhase: options.releasePhase ? Number(options.releasePhase) : void 0,
|
|
1993
2063
|
...body
|
|
1994
2064
|
});
|
|
1995
|
-
|
|
2065
|
+
printResult(res);
|
|
1996
2066
|
} catch (e) {
|
|
1997
|
-
|
|
2067
|
+
reportFailure("Request failed:", e.message);
|
|
1998
2068
|
}
|
|
1999
2069
|
});
|
|
2000
2070
|
publishCmd.command("language-update").description("Update app language info").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("--body <bodyFile>", "JSON body (must include lang)").option("-r, --release-type <releaseType>", "Release type").option("--release-phase <releasePhase>", "Release phase").action(async (options) => {
|
|
@@ -2006,9 +2076,9 @@ publishCmd.command("language-update").description("Update app language info").re
|
|
|
2006
2076
|
releasePhase: options.releasePhase ? Number(options.releasePhase) : void 0,
|
|
2007
2077
|
...body
|
|
2008
2078
|
});
|
|
2009
|
-
|
|
2079
|
+
printResult(res);
|
|
2010
2080
|
} catch (e) {
|
|
2011
|
-
|
|
2081
|
+
reportFailure("Request failed:", e.message);
|
|
2012
2082
|
}
|
|
2013
2083
|
});
|
|
2014
2084
|
publishCmd.command("language-delete").description("Delete app language info").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("-l, --lang <lang>", "Language to delete, e.g. zh-CN").option("-r, --release-type <releaseType>", "Release type").action(async (options) => {
|
|
@@ -2018,9 +2088,9 @@ publishCmd.command("language-delete").description("Delete app language info").re
|
|
|
2018
2088
|
lang: options.lang,
|
|
2019
2089
|
releaseType: options.releaseType ? Number(options.releaseType) : void 0
|
|
2020
2090
|
});
|
|
2021
|
-
|
|
2091
|
+
printResult(res);
|
|
2022
2092
|
} catch (e) {
|
|
2023
|
-
|
|
2093
|
+
reportFailure("Request failed:", e.message);
|
|
2024
2094
|
}
|
|
2025
2095
|
});
|
|
2026
2096
|
publishCmd.command("file-info-update").description("Update app file info (icons/screenshots/videos)").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("--body <bodyFile>", "JSON body of file lists").option("-r, --release-type <releaseType>", "Release type").option("--release-phase <releasePhase>", "Release phase").action(async (options) => {
|
|
@@ -2032,9 +2102,9 @@ publishCmd.command("file-info-update").description("Update app file info (icons/
|
|
|
2032
2102
|
releasePhase: options.releasePhase ? Number(options.releasePhase) : void 0,
|
|
2033
2103
|
...body
|
|
2034
2104
|
});
|
|
2035
|
-
|
|
2105
|
+
printResult(res);
|
|
2036
2106
|
} catch (e) {
|
|
2037
|
-
|
|
2107
|
+
reportFailure("Request failed:", e.message);
|
|
2038
2108
|
}
|
|
2039
2109
|
});
|
|
2040
2110
|
publishCmd.command("package-update").description("Report uploaded package to AGC (call after OBS upload if upload file used --no-bind)").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("--file-name <fileName>", "Uploaded file name").requiredOption("--object-id <objectId>", "Uploaded object ID").option("-r, --release-type <releaseType>", "Release type").option("--release-phase <releasePhase>", "Release phase").action(async (options) => {
|
|
@@ -2046,9 +2116,9 @@ publishCmd.command("package-update").description("Report uploaded package to AGC
|
|
|
2046
2116
|
releaseType: options.releaseType ? Number(options.releaseType) : void 0,
|
|
2047
2117
|
releasePhase: options.releasePhase ? Number(options.releasePhase) : void 0
|
|
2048
2118
|
});
|
|
2049
|
-
|
|
2119
|
+
printResult(res);
|
|
2050
2120
|
} catch (e) {
|
|
2051
|
-
|
|
2121
|
+
reportFailure("Request failed:", e.message);
|
|
2052
2122
|
}
|
|
2053
2123
|
});
|
|
2054
2124
|
publishCmd.command("release-time").description("Update version on-shelf time").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("--change-type <changeType>", "2 immediate, 3 change scheduled time").option("--release-time <releaseTime>", "UTC time yyyy-MM-ddTHH:mm:ssZZ").option("-r, --release-type <releaseType>", "Release type (default 1)").action(async (options) => {
|
|
@@ -2059,18 +2129,18 @@ publishCmd.command("release-time").description("Update version on-shelf time").r
|
|
|
2059
2129
|
releaseTime: options.releaseTime,
|
|
2060
2130
|
releaseType: options.releaseType ? Number(options.releaseType) : void 0
|
|
2061
2131
|
});
|
|
2062
|
-
|
|
2132
|
+
printResult(res);
|
|
2063
2133
|
} catch (e) {
|
|
2064
|
-
|
|
2134
|
+
reportFailure("Request failed:", e.message);
|
|
2065
2135
|
}
|
|
2066
2136
|
});
|
|
2067
2137
|
publishCmd.command("phased-release").description("Update phased release settings").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("--body <bodyFile>", "JSON body (versionId, releasePhase, state, ...)").action(async (options) => {
|
|
2068
2138
|
try {
|
|
2069
2139
|
const body = readJsonFile(options.body);
|
|
2070
2140
|
const res = await PublishService.updatePhasedRelease({ appId: options.appId, ...body });
|
|
2071
|
-
|
|
2141
|
+
printResult(res);
|
|
2072
2142
|
} catch (e) {
|
|
2073
|
-
|
|
2143
|
+
reportFailure("Request failed:", e.message);
|
|
2074
2144
|
}
|
|
2075
2145
|
});
|
|
2076
2146
|
publishCmd.command("package-info").description("Query package info by package ID").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("--package-id <packageId>", "Package ID").action(async (options) => {
|
|
@@ -2079,9 +2149,9 @@ publishCmd.command("package-info").description("Query package info by package ID
|
|
|
2079
2149
|
appId: options.appId,
|
|
2080
2150
|
packageId: options.packageId
|
|
2081
2151
|
});
|
|
2082
|
-
|
|
2152
|
+
printResult(res);
|
|
2083
2153
|
} catch (e) {
|
|
2084
|
-
|
|
2154
|
+
reportFailure("Request failed:", e.message);
|
|
2085
2155
|
}
|
|
2086
2156
|
});
|
|
2087
2157
|
publishCmd.command("compile-status").description("Query package compile/parse status").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("--pkg-ids <pkgIds>", "Comma separated package IDs").action(async (options) => {
|
|
@@ -2090,9 +2160,9 @@ publishCmd.command("compile-status").description("Query package compile/parse st
|
|
|
2090
2160
|
appId: options.appId,
|
|
2091
2161
|
pkgIds: options.pkgIds
|
|
2092
2162
|
});
|
|
2093
|
-
|
|
2163
|
+
printResult(res);
|
|
2094
2164
|
} catch (e) {
|
|
2095
|
-
|
|
2165
|
+
reportFailure("Request failed:", e.message);
|
|
2096
2166
|
}
|
|
2097
2167
|
});
|
|
2098
2168
|
publishCmd.command("version-list").description("Query brief info list of all version types (commercial + test)").requiredOption("-a, --app-id <appId>", "App ID").option("-p, --package-name <packageName>", "Package name").option("--state <state>", "Version state filter (comma-separated)").action(async (options) => {
|
|
@@ -2102,35 +2172,35 @@ publishCmd.command("version-list").description("Query brief info list of all ver
|
|
|
2102
2172
|
packageName: options.packageName,
|
|
2103
2173
|
state: options.state
|
|
2104
2174
|
});
|
|
2105
|
-
|
|
2175
|
+
printResult(res);
|
|
2106
2176
|
} catch (e) {
|
|
2107
|
-
|
|
2177
|
+
reportFailure("Request failed:", e.message);
|
|
2108
2178
|
}
|
|
2109
2179
|
});
|
|
2110
2180
|
publishCmd.command("version-voc").description("Query unresolved version VOC tickets").requiredOption("-a, --app-id <appId>", "App ID").option("--body <bodyFile>", "Optional JSON filter (vocId/vocDesc/pageNo/pageSize)").action(async (options) => {
|
|
2111
2181
|
try {
|
|
2112
2182
|
const body = options.body ? readJsonFile(options.body) : {};
|
|
2113
2183
|
const res = await PublishService.queryVersionVoc({ appId: options.appId, ...body });
|
|
2114
|
-
|
|
2184
|
+
printResult(res);
|
|
2115
2185
|
} catch (e) {
|
|
2116
|
-
|
|
2186
|
+
reportFailure("Request failed:", e.message);
|
|
2117
2187
|
}
|
|
2118
2188
|
});
|
|
2119
2189
|
publishCmd.command("qual-dependent").description("Query required qualification file definitions").action(async () => {
|
|
2120
2190
|
try {
|
|
2121
2191
|
const res = await PublishService.queryTagQualDependent();
|
|
2122
|
-
|
|
2192
|
+
printResult(res);
|
|
2123
2193
|
} catch (e) {
|
|
2124
|
-
|
|
2194
|
+
reportFailure("Request failed:", e.message);
|
|
2125
2195
|
}
|
|
2126
2196
|
});
|
|
2127
2197
|
publishCmd.command("qual-submit").description("Submit qualification review task").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("--body <bodyFile>", "JSON body with tagQualInfos").action(async (options) => {
|
|
2128
2198
|
try {
|
|
2129
2199
|
const body = readJsonFile(options.body);
|
|
2130
2200
|
const res = await PublishService.submitQualificationReview({ appId: options.appId, ...body });
|
|
2131
|
-
|
|
2201
|
+
printResult(res);
|
|
2132
2202
|
} catch (e) {
|
|
2133
|
-
|
|
2203
|
+
reportFailure("Request failed:", e.message);
|
|
2134
2204
|
}
|
|
2135
2205
|
});
|
|
2136
2206
|
publishCmd.command("qual-query").description("Query qualification review task details").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("--tag-ids <tagIds>", "Comma separated tag IDs").action(async (options) => {
|
|
@@ -2139,18 +2209,18 @@ publishCmd.command("qual-query").description("Query qualification review task de
|
|
|
2139
2209
|
appId: options.appId,
|
|
2140
2210
|
tagIds: options.tagIds
|
|
2141
2211
|
});
|
|
2142
|
-
|
|
2212
|
+
printResult(res);
|
|
2143
2213
|
} catch (e) {
|
|
2144
|
-
|
|
2214
|
+
reportFailure("Request failed:", e.message);
|
|
2145
2215
|
}
|
|
2146
2216
|
});
|
|
2147
2217
|
publishCmd.command("qual-update").description("Update qualification review task").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("--body <bodyFile>", "JSON body with tagQualInfos").action(async (options) => {
|
|
2148
2218
|
try {
|
|
2149
2219
|
const body = readJsonFile(options.body);
|
|
2150
2220
|
const res = await PublishService.updateQualificationReview({ appId: options.appId, ...body });
|
|
2151
|
-
|
|
2221
|
+
printResult(res);
|
|
2152
2222
|
} catch (e) {
|
|
2153
|
-
|
|
2223
|
+
reportFailure("Request failed:", e.message);
|
|
2154
2224
|
}
|
|
2155
2225
|
});
|
|
2156
2226
|
publishCmd.command("qual-cancel").description("Cancel qualification review task").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("--task-id <taskId>", "Task ID").action(async (options) => {
|
|
@@ -2159,9 +2229,9 @@ publishCmd.command("qual-cancel").description("Cancel qualification review task"
|
|
|
2159
2229
|
appId: options.appId,
|
|
2160
2230
|
taskId: options.taskId
|
|
2161
2231
|
});
|
|
2162
|
-
|
|
2232
|
+
printResult(res);
|
|
2163
2233
|
} catch (e) {
|
|
2164
|
-
|
|
2234
|
+
reportFailure("Request failed:", e.message);
|
|
2165
2235
|
}
|
|
2166
2236
|
});
|
|
2167
2237
|
publishCmd.command("qual-delete").description("Delete qualification review task").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("--tag-ids <tagIds>", "Comma separated tag IDs").action(async (options) => {
|
|
@@ -2170,18 +2240,18 @@ publishCmd.command("qual-delete").description("Delete qualification review task"
|
|
|
2170
2240
|
appId: options.appId,
|
|
2171
2241
|
tagIds: options.tagIds.split(",")
|
|
2172
2242
|
});
|
|
2173
|
-
|
|
2243
|
+
printResult(res);
|
|
2174
2244
|
} catch (e) {
|
|
2175
|
-
|
|
2245
|
+
reportFailure("Request failed:", e.message);
|
|
2176
2246
|
}
|
|
2177
2247
|
});
|
|
2178
2248
|
publishCmd.command("agreement-create").description("Create user agreement or privacy agreement (type in body)").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("--body <bodyFile>", "JSON body (type: 1 privacy / 2 user agreement, ...)").action(async (options) => {
|
|
2179
2249
|
try {
|
|
2180
2250
|
const body = readJsonFile(options.body);
|
|
2181
2251
|
const res = await PublishService.createAgreement({ appId: options.appId, ...body });
|
|
2182
|
-
|
|
2252
|
+
printResult(res);
|
|
2183
2253
|
} catch (e) {
|
|
2184
|
-
|
|
2254
|
+
reportFailure("Request failed:", e.message);
|
|
2185
2255
|
}
|
|
2186
2256
|
});
|
|
2187
2257
|
publishCmd.command("agreement-list").description("List user/privacy agreements").requiredOption("-a, --app-id <appId>", "App ID").option("--body <bodyFile>", "Optional JSON filter (type/status/name/...)").option("--type <type>", "1 privacy, 2 user agreement").action(async (options) => {
|
|
@@ -2189,18 +2259,18 @@ publishCmd.command("agreement-list").description("List user/privacy agreements")
|
|
|
2189
2259
|
const body = options.body ? readJsonFile(options.body) : {};
|
|
2190
2260
|
if (options.type !== void 0) body.type = Number(options.type);
|
|
2191
2261
|
const res = await PublishService.listAgreements({ appId: options.appId, ...body });
|
|
2192
|
-
|
|
2262
|
+
printResult(res);
|
|
2193
2263
|
} catch (e) {
|
|
2194
|
-
|
|
2264
|
+
reportFailure("Request failed:", e.message);
|
|
2195
2265
|
}
|
|
2196
2266
|
});
|
|
2197
2267
|
publishCmd.command("agreement-update").description("Update user/privacy agreement").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("--body <bodyFile>", "JSON body (id, defaultLang, agreementInfos, ...)").action(async (options) => {
|
|
2198
2268
|
try {
|
|
2199
2269
|
const body = readJsonFile(options.body);
|
|
2200
2270
|
const res = await PublishService.updateAgreement({ appId: options.appId, ...body });
|
|
2201
|
-
|
|
2271
|
+
printResult(res);
|
|
2202
2272
|
} catch (e) {
|
|
2203
|
-
|
|
2273
|
+
reportFailure("Request failed:", e.message);
|
|
2204
2274
|
}
|
|
2205
2275
|
});
|
|
2206
2276
|
publishCmd.command("privacy-submit").description("Submit privacy agreement for review").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("--id <agreementId>", "Agreement ID").option("--require-confirm <flag>", "requireConfirm: 0 or 1").action(async (options) => {
|
|
@@ -2210,9 +2280,9 @@ publishCmd.command("privacy-submit").description("Submit privacy agreement for r
|
|
|
2210
2280
|
id: options.id,
|
|
2211
2281
|
requireConfirm: options.requireConfirm !== void 0 ? Number(options.requireConfirm) : void 0
|
|
2212
2282
|
});
|
|
2213
|
-
|
|
2283
|
+
printResult(res);
|
|
2214
2284
|
} catch (e) {
|
|
2215
|
-
|
|
2285
|
+
reportFailure("Request failed:", e.message);
|
|
2216
2286
|
}
|
|
2217
2287
|
});
|
|
2218
2288
|
publishCmd.command("age-rating").description("Apply for age rating").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("--body <bodyFile>", "JSON body (feedback/expectedRating/...)").option("-r, --release-type <releaseType>", "Release type").option("--release-phase <releasePhase>", "Release phase").action(async (options) => {
|
|
@@ -2224,9 +2294,9 @@ publishCmd.command("age-rating").description("Apply for age rating").requiredOpt
|
|
|
2224
2294
|
releasePhase: options.releasePhase ? Number(options.releasePhase) : void 0,
|
|
2225
2295
|
...body
|
|
2226
2296
|
});
|
|
2227
|
-
|
|
2297
|
+
printResult(res);
|
|
2228
2298
|
} catch (e) {
|
|
2229
|
-
|
|
2299
|
+
reportFailure("Request failed:", e.message);
|
|
2230
2300
|
}
|
|
2231
2301
|
});
|
|
2232
2302
|
publishCmd.command("submit").description("Submit app for release review").requiredOption("-a, --app-id <appId>", "App ID").option("--body <bodyFile>", "Optional JSON (releaseTime/remark/releaseType/releasePhase/...)").option("-r, --release-type <releaseType>", "Release type").option("--release-phase <releasePhase>", "Release phase").option("--remark <remark>", "Submit remark").option("--release-time <releaseTime>", "UTC release time").action(async (options) => {
|
|
@@ -2237,9 +2307,9 @@ publishCmd.command("submit").description("Submit app for release review").requir
|
|
|
2237
2307
|
if (options.remark !== void 0) body.remark = options.remark;
|
|
2238
2308
|
if (options.releaseTime !== void 0) body.releaseTime = options.releaseTime;
|
|
2239
2309
|
const res = await PublishService.submitApp({ appId: options.appId, ...body });
|
|
2240
|
-
|
|
2310
|
+
printResult(res);
|
|
2241
2311
|
} catch (e) {
|
|
2242
|
-
|
|
2312
|
+
reportFailure("Request failed:", e.message);
|
|
2243
2313
|
}
|
|
2244
2314
|
});
|
|
2245
2315
|
publishCmd.command("cancel-review").description("Cancel an in-review version").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("-v, --version-id <versionId>", "Version ID").action(async (options) => {
|
|
@@ -2248,9 +2318,9 @@ publishCmd.command("cancel-review").description("Cancel an in-review version").r
|
|
|
2248
2318
|
appId: options.appId,
|
|
2249
2319
|
versionId: options.versionId
|
|
2250
2320
|
});
|
|
2251
|
-
|
|
2321
|
+
printResult(res);
|
|
2252
2322
|
} catch (e) {
|
|
2253
|
-
|
|
2323
|
+
reportFailure("Request failed:", e.message);
|
|
2254
2324
|
}
|
|
2255
2325
|
});
|
|
2256
2326
|
publishCmd.command("shelf-off").description("Take app off shelf").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("--reason <reason>", "Off-shelf reason").option("-r, --release-type <releaseType>", "Release type").action(async (options) => {
|
|
@@ -2260,16 +2330,16 @@ publishCmd.command("shelf-off").description("Take app off shelf").requiredOption
|
|
|
2260
2330
|
reason: options.reason,
|
|
2261
2331
|
releaseType: options.releaseType ? Number(options.releaseType) : void 0
|
|
2262
2332
|
});
|
|
2263
|
-
|
|
2333
|
+
printResult(res);
|
|
2264
2334
|
} catch (e) {
|
|
2265
|
-
|
|
2335
|
+
reportFailure("Request failed:", e.message);
|
|
2266
2336
|
}
|
|
2267
2337
|
});
|
|
2268
2338
|
var projectCmd = program.command("project").description("Project Management API commands");
|
|
2269
2339
|
projectCmd.command("list").description("List AGC projects (projectId for publish app-create)").action(async () => {
|
|
2270
2340
|
try {
|
|
2271
2341
|
const res = await ProjectService.listProjects();
|
|
2272
|
-
|
|
2342
|
+
printResult(res);
|
|
2273
2343
|
const list = res.projectList ?? [];
|
|
2274
2344
|
if (res.ret?.code === 0 && list.length > 0) {
|
|
2275
2345
|
console.error("projectId choices:");
|
|
@@ -2278,7 +2348,7 @@ projectCmd.command("list").description("List AGC projects (projectId for publish
|
|
|
2278
2348
|
}
|
|
2279
2349
|
}
|
|
2280
2350
|
} catch (e) {
|
|
2281
|
-
|
|
2351
|
+
reportFailure("Request failed:", e.message);
|
|
2282
2352
|
}
|
|
2283
2353
|
});
|
|
2284
2354
|
var uploadCmd = program.command("upload").description("Upload Management API commands");
|
|
@@ -2317,17 +2387,17 @@ uploadCmd.command("file").description("Upload a file (APP, APK, images, etc.); .
|
|
|
2317
2387
|
bound: bindRes.ret?.code === 0
|
|
2318
2388
|
}, null, 2));
|
|
2319
2389
|
if (bindRes.ret?.code !== 0) {
|
|
2320
|
-
|
|
2390
|
+
reportFailure(
|
|
2321
2391
|
"Package report failed (file is on OBS but AGC has no record):",
|
|
2322
2392
|
bindRes.ret?.msg || JSON.stringify(bindRes.ret)
|
|
2323
2393
|
);
|
|
2324
2394
|
}
|
|
2325
2395
|
} catch (e) {
|
|
2326
|
-
|
|
2396
|
+
reportFailure("Upload failed:", e.message);
|
|
2327
2397
|
}
|
|
2328
2398
|
});
|
|
2329
2399
|
var provisionCmd = program.command("provision").description("Provisioning API commands");
|
|
2330
|
-
provisionCmd.command("csr-generate").description("Generate a new keypair and CSR file").requiredOption("--alias <alias>", "Key alias").option("--pwd <pwd>", "Key password (default: CSPRNG hex, returned as .pwd; not written to disk)").option("--out-dir <outDir>", "Root output directory (default: ./.certs; each run adds a CSPRNG subdirectory)").option("--filename <filename>", "Shared random id for the cert subdirectory (files get key_/cert_/profile_ prefixes)").option("--sdk-path <sdkPath>", "Path to HarmonyOS SDK (or
|
|
2400
|
+
provisionCmd.command("csr-generate").description("Generate a new keypair and CSR file").requiredOption("--alias <alias>", "Key alias").option("--pwd <pwd>", "Key password (default: CSPRNG hex, returned as .pwd; not written to disk)").option("--out-dir <outDir>", "Root output directory (default: ./.certs; each run adds a CSPRNG subdirectory)").option("--filename <filename>", "Shared random id for the cert subdirectory (files get key_/cert_/profile_ prefixes)").option("--sdk-path <sdkPath>", "Path to HarmonyOS SDK (or DEVECO_HOME in .env)").option("--java-path <javaPath>", "Path to java executable (default: java)").action(async (options) => {
|
|
2331
2401
|
try {
|
|
2332
2402
|
const res = await SignService.createSignP12AndCsr({
|
|
2333
2403
|
alias: options.alias,
|
|
@@ -2338,30 +2408,30 @@ provisionCmd.command("csr-generate").description("Generate a new keypair and CSR
|
|
|
2338
2408
|
javaPath: options.javaPath
|
|
2339
2409
|
});
|
|
2340
2410
|
console.error("CSR generation successful.");
|
|
2341
|
-
|
|
2411
|
+
printResult(res);
|
|
2342
2412
|
} catch (e) {
|
|
2343
|
-
|
|
2413
|
+
reportFailure("CSR generation failed:", e.message);
|
|
2344
2414
|
}
|
|
2345
2415
|
});
|
|
2346
2416
|
provisionCmd.command("encrypt-pwd").description("\u52A0\u5BC6 P12 \u5BC6\u7801\uFF0C\u751F\u6210 build-profile.json5 \u6240\u9700\u7684 keyPassword / storePassword").requiredOption("--pwd <password>", "P12 \u5BC6\u7801\u660E\u6587").option("--config-dir <configDir>", "DevEco Studio \u914D\u7F6E\u76EE\u5F55 (\u9ED8\u8BA4 ~/.ohos/config)").action(async (options) => {
|
|
2347
2417
|
try {
|
|
2348
2418
|
const res = SignService.encryptPassword(options.pwd, options.configDir);
|
|
2349
|
-
|
|
2419
|
+
printResult(res);
|
|
2350
2420
|
} catch (e) {
|
|
2351
|
-
|
|
2421
|
+
reportFailure("\u52A0\u5BC6\u5931\u8D25:", e.message);
|
|
2352
2422
|
}
|
|
2353
2423
|
});
|
|
2354
2424
|
provisionCmd.command("cert-create").description("Create a certificate").requiredOption("--csr <csrFile>", "Path to CSR file").requiredOption("--cert-name <certName>", "Certificate name").requiredOption("--cert-type <certType>", "Certificate type (1: debug, 2: release, 3: in-house, 4: binary)").action(async (options) => {
|
|
2355
2425
|
try {
|
|
2356
|
-
const csrContent =
|
|
2426
|
+
const csrContent = fs8.readFileSync(options.csr, "utf8");
|
|
2357
2427
|
const res = await ProvisionService.createCert({
|
|
2358
2428
|
csr: csrContent,
|
|
2359
2429
|
certName: options.certName,
|
|
2360
2430
|
certType: Number(options.certType)
|
|
2361
2431
|
});
|
|
2362
|
-
|
|
2432
|
+
printResult(res);
|
|
2363
2433
|
} catch (e) {
|
|
2364
|
-
|
|
2434
|
+
reportFailure("Request failed:", e.message);
|
|
2365
2435
|
}
|
|
2366
2436
|
});
|
|
2367
2437
|
provisionCmd.command("cert-list").description("List certificates").option("-t, --cert-type <certType>", "Certificate type").option("--cert-ids <certIds>", "Comma separated certificate IDs").action(async (options) => {
|
|
@@ -2370,9 +2440,9 @@ provisionCmd.command("cert-list").description("List certificates").option("-t, -
|
|
|
2370
2440
|
if (options.certType) req.certType = Number(options.certType);
|
|
2371
2441
|
if (options.certIds) req.certIds = options.certIds.split(",");
|
|
2372
2442
|
const res = await ProvisionService.getCertList(req);
|
|
2373
|
-
|
|
2443
|
+
printResult(res);
|
|
2374
2444
|
} catch (e) {
|
|
2375
|
-
|
|
2445
|
+
reportFailure("Request failed:", e.message);
|
|
2376
2446
|
}
|
|
2377
2447
|
});
|
|
2378
2448
|
provisionCmd.command("cert-delete").description("Delete certificates").requiredOption("--cert-ids <certIds>", "Comma separated certificate IDs to delete").action(async (options) => {
|
|
@@ -2380,19 +2450,19 @@ provisionCmd.command("cert-delete").description("Delete certificates").requiredO
|
|
|
2380
2450
|
const res = await ProvisionService.deleteCert({
|
|
2381
2451
|
certIds: options.certIds.split(",")
|
|
2382
2452
|
});
|
|
2383
|
-
|
|
2453
|
+
printResult(res);
|
|
2384
2454
|
} catch (e) {
|
|
2385
|
-
|
|
2455
|
+
reportFailure("Request failed:", e.message);
|
|
2386
2456
|
}
|
|
2387
2457
|
});
|
|
2388
2458
|
provisionCmd.command("device-add").description("Add new devices").requiredOption("--devices <devicesFile>", 'Path to JSON file containing devices array [{"deviceName":"name","udid":"udid","deviceType":1}]').action(async (options) => {
|
|
2389
2459
|
try {
|
|
2390
|
-
const fileContent =
|
|
2460
|
+
const fileContent = fs8.readFileSync(options.devices, "utf8");
|
|
2391
2461
|
const deviceList = JSON.parse(fileContent);
|
|
2392
2462
|
const res = await ProvisionService.addDevice({ deviceList });
|
|
2393
|
-
|
|
2463
|
+
printResult(res);
|
|
2394
2464
|
} catch (e) {
|
|
2395
|
-
|
|
2465
|
+
reportFailure("Request failed:", e.message);
|
|
2396
2466
|
}
|
|
2397
2467
|
});
|
|
2398
2468
|
provisionCmd.command("device-list").description("List devices").option("--device-name <deviceName>", "Device name to search").option("--from <fromRecCount>", "Starting page").option("--max <maxReqCount>", "Max items per page").option("--order <order>", "1: create time desc, 2: name asc").action(async (options) => {
|
|
@@ -2403,9 +2473,9 @@ provisionCmd.command("device-list").description("List devices").option("--device
|
|
|
2403
2473
|
if (options.max) req.maxReqCount = Number(options.max);
|
|
2404
2474
|
if (options.order) req.order = Number(options.order);
|
|
2405
2475
|
const res = await ProvisionService.getDeviceList(req);
|
|
2406
|
-
|
|
2476
|
+
printResult(res);
|
|
2407
2477
|
} catch (e) {
|
|
2408
|
-
|
|
2478
|
+
reportFailure("Request failed:", e.message);
|
|
2409
2479
|
}
|
|
2410
2480
|
});
|
|
2411
2481
|
provisionCmd.command("device-delete").description("Delete devices").requiredOption("--device-ids <deviceIdList>", "Comma separated device IDs to delete").action(async (options) => {
|
|
@@ -2413,9 +2483,9 @@ provisionCmd.command("device-delete").description("Delete devices").requiredOpti
|
|
|
2413
2483
|
const res = await ProvisionService.deleteDevice({
|
|
2414
2484
|
deviceIdList: options.deviceIds.split(",")
|
|
2415
2485
|
});
|
|
2416
|
-
|
|
2486
|
+
printResult(res);
|
|
2417
2487
|
} catch (e) {
|
|
2418
|
-
|
|
2488
|
+
reportFailure("Request failed:", e.message);
|
|
2419
2489
|
}
|
|
2420
2490
|
});
|
|
2421
2491
|
provisionCmd.command("profile-create").description("Create a profile").requiredOption("--name <provisionName>", "Profile name").requiredOption("--type <provisionType>", "Profile type (1:debug, 2:release, 3:in-house, 6:specific device)").requiredOption("--cert <certId>", "Certificate ID").requiredOption("-a, --app-id <appId>", "App ID").option("--device-ids <deviceIdList>", "Comma separated device IDs").option("--acls <aclPermissionList>", "Comma separated ACL permissions").action(async (options) => {
|
|
@@ -2429,9 +2499,9 @@ provisionCmd.command("profile-create").description("Create a profile").requiredO
|
|
|
2429
2499
|
if (options.deviceIds) req.deviceIdList = options.deviceIds.split(",");
|
|
2430
2500
|
if (options.acls) req.aclPermissionList = options.acls.split(",");
|
|
2431
2501
|
const res = await ProvisionService.createProvision(req);
|
|
2432
|
-
|
|
2502
|
+
printResult(res);
|
|
2433
2503
|
} catch (e) {
|
|
2434
|
-
|
|
2504
|
+
reportFailure("Request failed:", e.message);
|
|
2435
2505
|
}
|
|
2436
2506
|
});
|
|
2437
2507
|
provisionCmd.command("profile-list").description("List profiles").requiredOption("-a, --app-id <appId>", "App ID").option("--profile-id <provisionId>", "Profile ID").option("--from <fromRecCount>", "Starting page").option("--max <maxReqCount>", "Max items per page").action(async (options) => {
|
|
@@ -2441,9 +2511,9 @@ provisionCmd.command("profile-list").description("List profiles").requiredOption
|
|
|
2441
2511
|
if (options.from) req.fromRecCount = Number(options.from);
|
|
2442
2512
|
if (options.max) req.maxReqCount = Number(options.max);
|
|
2443
2513
|
const res = await ProvisionService.getProvisionList(req);
|
|
2444
|
-
|
|
2514
|
+
printResult(res);
|
|
2445
2515
|
} catch (e) {
|
|
2446
|
-
|
|
2516
|
+
reportFailure("Request failed:", e.message);
|
|
2447
2517
|
}
|
|
2448
2518
|
});
|
|
2449
2519
|
provisionCmd.command("profile-update").description("Update profile devices").requiredOption("--id <provisionId>", "Profile ID").requiredOption("--device-ids <deviceIdList>", "Comma separated device IDs").action(async (options) => {
|
|
@@ -2452,17 +2522,17 @@ provisionCmd.command("profile-update").description("Update profile devices").req
|
|
|
2452
2522
|
provisionId: options.id,
|
|
2453
2523
|
deviceIdList: options.deviceIds.split(",")
|
|
2454
2524
|
});
|
|
2455
|
-
|
|
2525
|
+
printResult(res);
|
|
2456
2526
|
} catch (e) {
|
|
2457
|
-
|
|
2527
|
+
reportFailure("Request failed:", e.message);
|
|
2458
2528
|
}
|
|
2459
2529
|
});
|
|
2460
2530
|
provisionCmd.command("profile-delete").description("Delete a profile").requiredOption("--id <id>", "Profile ID to delete").action(async (options) => {
|
|
2461
2531
|
try {
|
|
2462
2532
|
const res = await ProvisionService.deleteProvision({ id: options.id });
|
|
2463
|
-
|
|
2533
|
+
printResult(res);
|
|
2464
2534
|
} catch (e) {
|
|
2465
|
-
|
|
2535
|
+
reportFailure("Request failed:", e.message);
|
|
2466
2536
|
}
|
|
2467
2537
|
});
|
|
2468
2538
|
provisionCmd.command("fp-add").description("Add certificate fingerprints").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("--fps <fingerprintList>", "Comma separated fingerprints").action(async (options) => {
|
|
@@ -2471,17 +2541,17 @@ provisionCmd.command("fp-add").description("Add certificate fingerprints").requi
|
|
|
2471
2541
|
appId: options.appId,
|
|
2472
2542
|
fingerprintList: options.fps.split(",")
|
|
2473
2543
|
});
|
|
2474
|
-
|
|
2544
|
+
printResult(res);
|
|
2475
2545
|
} catch (e) {
|
|
2476
|
-
|
|
2546
|
+
reportFailure("Request failed:", e.message);
|
|
2477
2547
|
}
|
|
2478
2548
|
});
|
|
2479
2549
|
provisionCmd.command("fp-list").description("List certificate fingerprints").requiredOption("-a, --app-id <appId>", "App ID").action(async (options) => {
|
|
2480
2550
|
try {
|
|
2481
2551
|
const res = await ProvisionService.getFingerprintList({ appId: options.appId });
|
|
2482
|
-
|
|
2552
|
+
printResult(res);
|
|
2483
2553
|
} catch (e) {
|
|
2484
|
-
|
|
2554
|
+
reportFailure("Request failed:", e.message);
|
|
2485
2555
|
}
|
|
2486
2556
|
});
|
|
2487
2557
|
provisionCmd.command("fp-delete").description("Delete certificate fingerprints").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("--fps <fingerprintList>", "Comma separated fingerprints to delete").action(async (options) => {
|
|
@@ -2490,9 +2560,9 @@ provisionCmd.command("fp-delete").description("Delete certificate fingerprints")
|
|
|
2490
2560
|
appId: options.appId,
|
|
2491
2561
|
fingerprintList: options.fps.split(",")
|
|
2492
2562
|
});
|
|
2493
|
-
|
|
2563
|
+
printResult(res);
|
|
2494
2564
|
} catch (e) {
|
|
2495
|
-
|
|
2565
|
+
reportFailure("Request failed:", e.message);
|
|
2496
2566
|
}
|
|
2497
2567
|
});
|
|
2498
2568
|
provisionCmd.command("acl-eligible").description("List eligible ACL permissions that can be applied for").requiredOption("-a, --app-id <appId>", "App ID").option("-l, --lang <lang>", "Language: zh / en / ru (default zh)").option("--start <start>", "Start page (default 1)").option("--page-size <pageSize>", "Page size 1-1000 (default 10)").action(async (options) => {
|
|
@@ -2503,37 +2573,37 @@ provisionCmd.command("acl-eligible").description("List eligible ACL permissions
|
|
|
2503
2573
|
start: options.start ? Number(options.start) : void 0,
|
|
2504
2574
|
pageSize: options.pageSize ? Number(options.pageSize) : void 0
|
|
2505
2575
|
});
|
|
2506
|
-
|
|
2576
|
+
printResult(res);
|
|
2507
2577
|
} catch (e) {
|
|
2508
|
-
|
|
2578
|
+
reportFailure("Request failed:", e.message);
|
|
2509
2579
|
}
|
|
2510
2580
|
});
|
|
2511
2581
|
provisionCmd.command("acl-apply").description("Apply for restricted ACL permissions").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("--acls <aclsFile>", 'Path to JSON file containing ACL permissions [{"name":"name","reason":"reason"}]').option("--attachment <attachment>", "Attachment object ID").action(async (options) => {
|
|
2512
2582
|
try {
|
|
2513
|
-
const fileContent =
|
|
2583
|
+
const fileContent = fs8.readFileSync(options.acls, "utf8");
|
|
2514
2584
|
const aclPermissionList = JSON.parse(fileContent);
|
|
2515
2585
|
const req = { appId: options.appId, aclPermissionList };
|
|
2516
2586
|
if (options.attachment) req.attachment = options.attachment;
|
|
2517
2587
|
const res = await ProvisionService.applyACL(req);
|
|
2518
|
-
|
|
2588
|
+
printResult(res);
|
|
2519
2589
|
} catch (e) {
|
|
2520
|
-
|
|
2590
|
+
reportFailure("Request failed:", e.message);
|
|
2521
2591
|
}
|
|
2522
2592
|
});
|
|
2523
2593
|
provisionCmd.command("acl-status").description("Check ACL permission apply status").requiredOption("-a, --app-id <appId>", "App ID").action(async (options) => {
|
|
2524
2594
|
try {
|
|
2525
2595
|
const res = await ProvisionService.getACLStatus({ appId: options.appId });
|
|
2526
|
-
|
|
2596
|
+
printResult(res);
|
|
2527
2597
|
} catch (e) {
|
|
2528
|
-
|
|
2598
|
+
reportFailure("Request failed:", e.message);
|
|
2529
2599
|
}
|
|
2530
2600
|
});
|
|
2531
2601
|
provisionCmd.command("acl-query").description("Query granted ACL permissions").requiredOption("-a, --app-id <appId>", "App ID").action(async (options) => {
|
|
2532
2602
|
try {
|
|
2533
2603
|
const res = await ProvisionService.getACLQuery({ appId: options.appId });
|
|
2534
|
-
|
|
2604
|
+
printResult(res);
|
|
2535
2605
|
} catch (e) {
|
|
2536
|
-
|
|
2606
|
+
reportFailure("Request failed:", e.message);
|
|
2537
2607
|
}
|
|
2538
2608
|
});
|
|
2539
2609
|
var domainCmd = program.command("domain").description("Domain Management API commands");
|
|
@@ -2543,23 +2613,23 @@ domainCmd.command("query").description("Query domain configuration").requiredOpt
|
|
|
2543
2613
|
appId: options.appId,
|
|
2544
2614
|
category: options.category
|
|
2545
2615
|
});
|
|
2546
|
-
|
|
2616
|
+
printResult(res);
|
|
2547
2617
|
} catch (e) {
|
|
2548
|
-
|
|
2618
|
+
reportFailure("Request failed:", e.message);
|
|
2549
2619
|
}
|
|
2550
2620
|
});
|
|
2551
2621
|
domainCmd.command("update").description("Add or update domain configuration").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("-c, --category <category>", "Category: server or business").requiredOption("--domains <domainsFile>", 'Path to JSON file containing domains array [{"type":"httpRequest","value":"https://..."}]').action(async (options) => {
|
|
2552
2622
|
try {
|
|
2553
|
-
const fileContent =
|
|
2623
|
+
const fileContent = fs8.readFileSync(options.domains, "utf8");
|
|
2554
2624
|
const domains = JSON.parse(fileContent);
|
|
2555
2625
|
const res = await DomainService.updateDomain({
|
|
2556
2626
|
appId: options.appId,
|
|
2557
2627
|
category: options.category,
|
|
2558
2628
|
domains
|
|
2559
2629
|
});
|
|
2560
|
-
|
|
2630
|
+
printResult(res);
|
|
2561
2631
|
} catch (e) {
|
|
2562
|
-
|
|
2632
|
+
reportFailure("Request failed:", e.message);
|
|
2563
2633
|
}
|
|
2564
2634
|
});
|
|
2565
2635
|
domainCmd.command("config").description("Query domain modification counts and limits").requiredOption("-a, --app-id <appId>", "App ID").action(async (options) => {
|
|
@@ -2567,9 +2637,9 @@ domainCmd.command("config").description("Query domain modification counts and li
|
|
|
2567
2637
|
const res = await DomainService.queryDomainConfig({
|
|
2568
2638
|
appId: options.appId
|
|
2569
2639
|
});
|
|
2570
|
-
|
|
2640
|
+
printResult(res);
|
|
2571
2641
|
} catch (e) {
|
|
2572
|
-
|
|
2642
|
+
reportFailure("Request failed:", e.message);
|
|
2573
2643
|
}
|
|
2574
2644
|
});
|
|
2575
2645
|
domainCmd.command("verify-file").description("Download domain verify file").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("-o, --output <outputPath>", "Output file path").action(async (options) => {
|
|
@@ -2580,20 +2650,20 @@ domainCmd.command("verify-file").description("Download domain verify file").requ
|
|
|
2580
2650
|
}, options.output);
|
|
2581
2651
|
console.log("Download successful.");
|
|
2582
2652
|
} catch (e) {
|
|
2583
|
-
|
|
2653
|
+
reportFailure("Download failed:", e.message);
|
|
2584
2654
|
}
|
|
2585
2655
|
});
|
|
2586
2656
|
domainCmd.command("pre-check").description("Pre-check business domain configuration").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("--domain <domainFile>", 'Path to JSON file containing domain object {"type":"webView","value":"https://..."}').action(async (options) => {
|
|
2587
2657
|
try {
|
|
2588
|
-
const fileContent =
|
|
2658
|
+
const fileContent = fs8.readFileSync(options.domain, "utf8");
|
|
2589
2659
|
const domain = JSON.parse(fileContent);
|
|
2590
2660
|
const res = await DomainService.preCheckDomain({
|
|
2591
2661
|
appId: options.appId,
|
|
2592
2662
|
domain
|
|
2593
2663
|
});
|
|
2594
|
-
|
|
2664
|
+
printResult(res);
|
|
2595
2665
|
} catch (e) {
|
|
2596
|
-
|
|
2666
|
+
reportFailure("Request failed:", e.message);
|
|
2597
2667
|
}
|
|
2598
2668
|
});
|
|
2599
2669
|
var testCmd = program.command("test").description("Testing API commands (invite/open test versions, groups, invite codes)");
|
|
@@ -2606,9 +2676,9 @@ testCmd.command("version-create").description("Create a test version").requiredO
|
|
|
2606
2676
|
releaseType: options.releaseType ? Number(options.releaseType) : void 0,
|
|
2607
2677
|
onshelfSelfDetect: options.onshelfSelfDetect !== void 0 ? Number(options.onshelfSelfDetect) : void 0
|
|
2608
2678
|
});
|
|
2609
|
-
|
|
2679
|
+
printResult(res);
|
|
2610
2680
|
} catch (e) {
|
|
2611
|
-
|
|
2681
|
+
reportFailure("Request failed:", e.message);
|
|
2612
2682
|
}
|
|
2613
2683
|
});
|
|
2614
2684
|
testCmd.command("version-detect").description("Query onshelf self-detect report").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("-v, --version-id <versionId>", "Test version ID").action(async (options) => {
|
|
@@ -2617,9 +2687,9 @@ testCmd.command("version-detect").description("Query onshelf self-detect report"
|
|
|
2617
2687
|
appId: options.appId,
|
|
2618
2688
|
versionId: options.versionId
|
|
2619
2689
|
});
|
|
2620
|
-
|
|
2690
|
+
printResult(res);
|
|
2621
2691
|
} catch (e) {
|
|
2622
|
-
|
|
2692
|
+
reportFailure("Request failed:", e.message);
|
|
2623
2693
|
}
|
|
2624
2694
|
});
|
|
2625
2695
|
testCmd.command("pkg-add").description("Add package to a test version (objectId from upload)").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("--file-name <fileName>", "Uploaded file name").requiredOption("--object-id <objectId>", "Uploaded object ID").option("--distribute-mode <mode>", "1: test zone, 2: AppGallery").action(async (options) => {
|
|
@@ -2629,36 +2699,36 @@ testCmd.command("pkg-add").description("Add package to a test version (objectId
|
|
|
2629
2699
|
distributeMode: options.distributeMode ? Number(options.distributeMode) : void 0,
|
|
2630
2700
|
file: { fileName: options.fileName, objectId: options.objectId }
|
|
2631
2701
|
});
|
|
2632
|
-
|
|
2702
|
+
printResult(res);
|
|
2633
2703
|
} catch (e) {
|
|
2634
|
-
|
|
2704
|
+
reportFailure("Request failed:", e.message);
|
|
2635
2705
|
}
|
|
2636
2706
|
});
|
|
2637
2707
|
testCmd.command("version-update").description("Update a test version (bind pkg/groups/languages via JSON body)").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("--body <bodyFile>", "JSON body (must include versionId; optional pkgId, openTestInfo, ...)").action(async (options) => {
|
|
2638
2708
|
try {
|
|
2639
2709
|
const body = readJsonFile(options.body);
|
|
2640
2710
|
const res = await TestingService.updateVersion({ appId: options.appId, ...body });
|
|
2641
|
-
|
|
2711
|
+
printResult(res);
|
|
2642
2712
|
} catch (e) {
|
|
2643
|
-
|
|
2713
|
+
reportFailure("Request failed:", e.message);
|
|
2644
2714
|
}
|
|
2645
2715
|
});
|
|
2646
2716
|
testCmd.command("version-release").description("Update effective/release settings of a test version").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("--body <bodyFile>", "JSON body (must include versionId)").action(async (options) => {
|
|
2647
2717
|
try {
|
|
2648
2718
|
const body = readJsonFile(options.body);
|
|
2649
2719
|
const res = await TestingService.releaseVersion({ appId: options.appId, ...body });
|
|
2650
|
-
|
|
2720
|
+
printResult(res);
|
|
2651
2721
|
} catch (e) {
|
|
2652
|
-
|
|
2722
|
+
reportFailure("Request failed:", e.message);
|
|
2653
2723
|
}
|
|
2654
2724
|
});
|
|
2655
2725
|
testCmd.command("version-opentest").description("Update open-test time window / install quota / bind groups").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("--body <bodyFile>", "JSON body (must include versionId)").action(async (options) => {
|
|
2656
2726
|
try {
|
|
2657
2727
|
const body = readJsonFile(options.body);
|
|
2658
2728
|
const res = await TestingService.updateOpenTest({ appId: options.appId, ...body });
|
|
2659
|
-
|
|
2729
|
+
printResult(res);
|
|
2660
2730
|
} catch (e) {
|
|
2661
|
-
|
|
2731
|
+
reportFailure("Request failed:", e.message);
|
|
2662
2732
|
}
|
|
2663
2733
|
});
|
|
2664
2734
|
testCmd.command("version-submit").description("Submit a test version for review").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("-v, --version-id <versionId>", "Test version ID").action(async (options) => {
|
|
@@ -2667,9 +2737,9 @@ testCmd.command("version-submit").description("Submit a test version for review"
|
|
|
2667
2737
|
appId: options.appId,
|
|
2668
2738
|
versionId: options.versionId
|
|
2669
2739
|
});
|
|
2670
|
-
|
|
2740
|
+
printResult(res);
|
|
2671
2741
|
} catch (e) {
|
|
2672
|
-
|
|
2742
|
+
reportFailure("Request failed:", e.message);
|
|
2673
2743
|
}
|
|
2674
2744
|
});
|
|
2675
2745
|
testCmd.command("version-stop").description("Stop a test version").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("-v, --version-id <versionId>", "Test version ID").action(async (options) => {
|
|
@@ -2678,9 +2748,9 @@ testCmd.command("version-stop").description("Stop a test version").requiredOptio
|
|
|
2678
2748
|
appId: options.appId,
|
|
2679
2749
|
versionId: options.versionId
|
|
2680
2750
|
});
|
|
2681
|
-
|
|
2751
|
+
printResult(res);
|
|
2682
2752
|
} catch (e) {
|
|
2683
|
-
|
|
2753
|
+
reportFailure("Request failed:", e.message);
|
|
2684
2754
|
}
|
|
2685
2755
|
});
|
|
2686
2756
|
testCmd.command("version-delete").description("Delete a test version").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("-v, --version-id <versionId>", "Test version ID").action(async (options) => {
|
|
@@ -2689,9 +2759,9 @@ testCmd.command("version-delete").description("Delete a test version").requiredO
|
|
|
2689
2759
|
appId: options.appId,
|
|
2690
2760
|
versionId: options.versionId
|
|
2691
2761
|
});
|
|
2692
|
-
|
|
2762
|
+
printResult(res);
|
|
2693
2763
|
} catch (e) {
|
|
2694
|
-
|
|
2764
|
+
reportFailure("Request failed:", e.message);
|
|
2695
2765
|
}
|
|
2696
2766
|
});
|
|
2697
2767
|
testCmd.command("group-add").description("Create a test group").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("--name <groupName>", "Group name").option("--type <groupType>", "0 external (default), 1 internal").action(async (options) => {
|
|
@@ -2701,9 +2771,9 @@ testCmd.command("group-add").description("Create a test group").requiredOption("
|
|
|
2701
2771
|
groupName: options.name,
|
|
2702
2772
|
groupType: options.type !== void 0 ? Number(options.type) : void 0
|
|
2703
2773
|
});
|
|
2704
|
-
|
|
2774
|
+
printResult(res);
|
|
2705
2775
|
} catch (e) {
|
|
2706
|
-
|
|
2776
|
+
reportFailure("Request failed:", e.message);
|
|
2707
2777
|
}
|
|
2708
2778
|
});
|
|
2709
2779
|
testCmd.command("group-list").description("List test groups").requiredOption("-a, --app-id <appId>", "App ID").option("--type <groupType>", "0 external, 1 internal").option("--current <current>", "Page number").option("--page-size <pageSize>", "Page size").action(async (options) => {
|
|
@@ -2714,9 +2784,9 @@ testCmd.command("group-list").description("List test groups").requiredOption("-a
|
|
|
2714
2784
|
current: options.current ? Number(options.current) : void 0,
|
|
2715
2785
|
pageSize: options.pageSize ? Number(options.pageSize) : void 0
|
|
2716
2786
|
});
|
|
2717
|
-
|
|
2787
|
+
printResult(res);
|
|
2718
2788
|
} catch (e) {
|
|
2719
|
-
|
|
2789
|
+
reportFailure("Request failed:", e.message);
|
|
2720
2790
|
}
|
|
2721
2791
|
});
|
|
2722
2792
|
testCmd.command("group-delete").description("Delete a test group").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("-g, --group-id <groupId>", "Group ID").action(async (options) => {
|
|
@@ -2725,9 +2795,9 @@ testCmd.command("group-delete").description("Delete a test group").requiredOptio
|
|
|
2725
2795
|
appId: options.appId,
|
|
2726
2796
|
groupId: options.groupId
|
|
2727
2797
|
});
|
|
2728
|
-
|
|
2798
|
+
printResult(res);
|
|
2729
2799
|
} catch (e) {
|
|
2730
|
-
|
|
2800
|
+
reportFailure("Request failed:", e.message);
|
|
2731
2801
|
}
|
|
2732
2802
|
});
|
|
2733
2803
|
testCmd.command("group-edit").description("Rename a test group").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("-g, --group-id <groupId>", "Group ID").requiredOption("--name <groupName>", "New group name").action(async (options) => {
|
|
@@ -2737,9 +2807,9 @@ testCmd.command("group-edit").description("Rename a test group").requiredOption(
|
|
|
2737
2807
|
groupId: options.groupId,
|
|
2738
2808
|
groupName: options.name
|
|
2739
2809
|
});
|
|
2740
|
-
|
|
2810
|
+
printResult(res);
|
|
2741
2811
|
} catch (e) {
|
|
2742
|
-
|
|
2812
|
+
reportFailure("Request failed:", e.message);
|
|
2743
2813
|
}
|
|
2744
2814
|
});
|
|
2745
2815
|
testCmd.command("group-user-list").description("List members of a test group").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("-g, --group-id <groupId>", "Group ID").option("--current <current>", "Page number").option("--page-size <pageSize>", "Page size").action(async (options) => {
|
|
@@ -2750,18 +2820,18 @@ testCmd.command("group-user-list").description("List members of a test group").r
|
|
|
2750
2820
|
current: options.current ? Number(options.current) : void 0,
|
|
2751
2821
|
pageSize: options.pageSize ? Number(options.pageSize) : void 0
|
|
2752
2822
|
});
|
|
2753
|
-
|
|
2823
|
+
printResult(res);
|
|
2754
2824
|
} catch (e) {
|
|
2755
|
-
|
|
2825
|
+
reportFailure("Request failed:", e.message);
|
|
2756
2826
|
}
|
|
2757
2827
|
});
|
|
2758
2828
|
testCmd.command("group-user-add").description("Add a member to a test group").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("--body <bodyFile>", "JSON body: groupId, nickName/hwAccount/uid, ...").action(async (options) => {
|
|
2759
2829
|
try {
|
|
2760
2830
|
const body = readJsonFile(options.body);
|
|
2761
2831
|
const res = await TestingService.addGroupUser({ appId: options.appId, ...body });
|
|
2762
|
-
|
|
2832
|
+
printResult(res);
|
|
2763
2833
|
} catch (e) {
|
|
2764
|
-
|
|
2834
|
+
reportFailure("Request failed:", e.message);
|
|
2765
2835
|
}
|
|
2766
2836
|
});
|
|
2767
2837
|
testCmd.command("group-user-delete").description("Delete members from a test group").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("-g, --group-id <groupId>", "Group ID").requiredOption("--tester-ids <testerIds>", "Comma separated tester IDs").action(async (options) => {
|
|
@@ -2771,9 +2841,9 @@ testCmd.command("group-user-delete").description("Delete members from a test gro
|
|
|
2771
2841
|
groupId: options.groupId,
|
|
2772
2842
|
deleteTesterIds: options.testerIds.split(",")
|
|
2773
2843
|
});
|
|
2774
|
-
|
|
2844
|
+
printResult(res);
|
|
2775
2845
|
} catch (e) {
|
|
2776
|
-
|
|
2846
|
+
reportFailure("Request failed:", e.message);
|
|
2777
2847
|
}
|
|
2778
2848
|
});
|
|
2779
2849
|
testCmd.command("group-notify").description("Send invite-test notification to group members").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("-g, --group-id <groupId>", "Group ID").requiredOption("--tester-ids <testerIds>", "Comma separated tester IDs").action(async (options) => {
|
|
@@ -2783,9 +2853,9 @@ testCmd.command("group-notify").description("Send invite-test notification to gr
|
|
|
2783
2853
|
groupId: options.groupId,
|
|
2784
2854
|
testerIds: options.testerIds.split(",")
|
|
2785
2855
|
});
|
|
2786
|
-
|
|
2856
|
+
printResult(res);
|
|
2787
2857
|
} catch (e) {
|
|
2788
|
-
|
|
2858
|
+
reportFailure("Request failed:", e.message);
|
|
2789
2859
|
}
|
|
2790
2860
|
});
|
|
2791
2861
|
testCmd.command("invite-code-create").description("Generate an invitation code for a group").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("-g, --group-id <groupId>", "Group ID").requiredOption("--valid-days <days>", "Valid days (max 30)").requiredOption("--invite-limit <limit>", "Invite limit (max 10000)").action(async (options) => {
|
|
@@ -2796,9 +2866,9 @@ testCmd.command("invite-code-create").description("Generate an invitation code f
|
|
|
2796
2866
|
invitationCodeValidDays: Number(options.validDays),
|
|
2797
2867
|
invitationCodeInviteLimit: Number(options.inviteLimit)
|
|
2798
2868
|
});
|
|
2799
|
-
|
|
2869
|
+
printResult(res);
|
|
2800
2870
|
} catch (e) {
|
|
2801
|
-
|
|
2871
|
+
reportFailure("Request failed:", e.message);
|
|
2802
2872
|
}
|
|
2803
2873
|
});
|
|
2804
2874
|
testCmd.command("invite-code-list").description("Query invitation codes of a group").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("-g, --group-id <groupId>", "Group ID").action(async (options) => {
|
|
@@ -2807,9 +2877,9 @@ testCmd.command("invite-code-list").description("Query invitation codes of a gro
|
|
|
2807
2877
|
appId: options.appId,
|
|
2808
2878
|
groupId: options.groupId
|
|
2809
2879
|
});
|
|
2810
|
-
|
|
2880
|
+
printResult(res);
|
|
2811
2881
|
} catch (e) {
|
|
2812
|
-
|
|
2882
|
+
reportFailure("Request failed:", e.message);
|
|
2813
2883
|
}
|
|
2814
2884
|
});
|
|
2815
2885
|
testCmd.command("invite-code-stop").description("Stop an invitation code").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("--code-id <invitationCodeId>", "Invitation code ID").action(async (options) => {
|
|
@@ -2818,9 +2888,9 @@ testCmd.command("invite-code-stop").description("Stop an invitation code").requi
|
|
|
2818
2888
|
appId: options.appId,
|
|
2819
2889
|
invitationCodeId: options.codeId
|
|
2820
2890
|
});
|
|
2821
|
-
|
|
2891
|
+
printResult(res);
|
|
2822
2892
|
} catch (e) {
|
|
2823
|
-
|
|
2893
|
+
reportFailure("Request failed:", e.message);
|
|
2824
2894
|
}
|
|
2825
2895
|
});
|
|
2826
2896
|
testCmd.command("invite-code-delete").description("Delete an invitation code").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("--code-id <invitationCodeId>", "Invitation code ID").action(async (options) => {
|
|
@@ -2829,9 +2899,9 @@ testCmd.command("invite-code-delete").description("Delete an invitation code").r
|
|
|
2829
2899
|
appId: options.appId,
|
|
2830
2900
|
invitationCodeId: options.codeId
|
|
2831
2901
|
});
|
|
2832
|
-
|
|
2902
|
+
printResult(res);
|
|
2833
2903
|
} catch (e) {
|
|
2834
|
-
|
|
2904
|
+
reportFailure("Request failed:", e.message);
|
|
2835
2905
|
}
|
|
2836
2906
|
});
|
|
2837
2907
|
testCmd.command("public-link-create").description("Create a public test link for a group").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("-g, --group-id <groupId>", "Group ID").requiredOption("--limit <limit>", "Install/limit count").action(async (options) => {
|
|
@@ -2841,9 +2911,9 @@ testCmd.command("public-link-create").description("Create a public test link for
|
|
|
2841
2911
|
groupId: options.groupId,
|
|
2842
2912
|
limit: Number(options.limit)
|
|
2843
2913
|
});
|
|
2844
|
-
|
|
2914
|
+
printResult(res);
|
|
2845
2915
|
} catch (e) {
|
|
2846
|
-
|
|
2916
|
+
reportFailure("Request failed:", e.message);
|
|
2847
2917
|
}
|
|
2848
2918
|
});
|
|
2849
2919
|
testCmd.command("public-link-edit").description("Edit a public test link").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("-g, --group-id <groupId>", "Group ID").option("--limit <limit>", "Install/limit count").option("--status <status>", "Link status").action(async (options) => {
|
|
@@ -2854,9 +2924,9 @@ testCmd.command("public-link-edit").description("Edit a public test link").requi
|
|
|
2854
2924
|
limit: options.limit !== void 0 ? Number(options.limit) : void 0,
|
|
2855
2925
|
status: options.status !== void 0 ? Number(options.status) : void 0
|
|
2856
2926
|
});
|
|
2857
|
-
|
|
2927
|
+
printResult(res);
|
|
2858
2928
|
} catch (e) {
|
|
2859
|
-
|
|
2929
|
+
reportFailure("Request failed:", e.message);
|
|
2860
2930
|
}
|
|
2861
2931
|
});
|
|
2862
2932
|
testCmd.command("public-link-query").description("Query a public test link").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("-g, --group-id <groupId>", "Group ID").action(async (options) => {
|
|
@@ -2865,37 +2935,38 @@ testCmd.command("public-link-query").description("Query a public test link").req
|
|
|
2865
2935
|
appId: options.appId,
|
|
2866
2936
|
groupId: options.groupId
|
|
2867
2937
|
});
|
|
2868
|
-
|
|
2938
|
+
printResult(res);
|
|
2869
2939
|
} catch (e) {
|
|
2870
|
-
|
|
2940
|
+
reportFailure("Request failed:", e.message);
|
|
2871
2941
|
}
|
|
2872
2942
|
});
|
|
2873
2943
|
testCmd.command("feedback-dimension").description("Query tester feedback dimensions").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("--body <bodyFile>", "JSON filter body (startTime/endTime/...)").action(async (options) => {
|
|
2874
2944
|
try {
|
|
2875
2945
|
const body = readJsonFile(options.body);
|
|
2876
2946
|
const res = await TestingService.queryFeedbackDimension({ appId: options.appId, ...body });
|
|
2877
|
-
|
|
2947
|
+
printResult(res);
|
|
2878
2948
|
} catch (e) {
|
|
2879
|
-
|
|
2949
|
+
reportFailure("Request failed:", e.message);
|
|
2880
2950
|
}
|
|
2881
2951
|
});
|
|
2882
2952
|
testCmd.command("feedback-query").description("Query tester feedback list").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("--body <bodyFile>", "JSON filter body (startTime/endTime/currentPage/...)").action(async (options) => {
|
|
2883
2953
|
try {
|
|
2884
2954
|
const body = readJsonFile(options.body);
|
|
2885
2955
|
const res = await TestingService.queryFeedback({ appId: options.appId, ...body });
|
|
2886
|
-
|
|
2956
|
+
printResult(res);
|
|
2887
2957
|
} catch (e) {
|
|
2888
|
-
|
|
2958
|
+
reportFailure("Request failed:", e.message);
|
|
2889
2959
|
}
|
|
2890
2960
|
});
|
|
2891
2961
|
testCmd.command("feedback-delete").description("Delete tester feedback").requiredOption("-a, --app-id <appId>", "App ID").requiredOption("--body <bodyFile>", "JSON body: delFeedBackInfos, deleteMode").action(async (options) => {
|
|
2892
2962
|
try {
|
|
2893
2963
|
const body = readJsonFile(options.body);
|
|
2894
2964
|
const res = await TestingService.deleteFeedback({ appId: options.appId, ...body });
|
|
2895
|
-
|
|
2965
|
+
printResult(res);
|
|
2896
2966
|
} catch (e) {
|
|
2897
|
-
|
|
2967
|
+
reportFailure("Request failed:", e.message);
|
|
2898
2968
|
}
|
|
2899
2969
|
});
|
|
2900
|
-
program.
|
|
2901
|
-
|
|
2970
|
+
program.parseAsync(process.argv).catch((error) => {
|
|
2971
|
+
reportFailure(error instanceof Error ? error.message : String(error));
|
|
2972
|
+
});
|