@botiverse/hands-cli 0.5.31 → 0.5.33
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/dist/commands/agc.js +2 -1
- package/dist/commands/agc.js.map +1 -1
- package/dist/commands/apps.js +8 -7
- package/dist/commands/apps.js.map +1 -1
- package/dist/commands/builds.js +132 -17
- package/dist/commands/builds.js.map +1 -1
- package/dist/commands/channels.js +5 -4
- package/dist/commands/channels.js.map +1 -1
- package/dist/commands/deploy_tokens.js +3 -2
- package/dist/commands/deploy_tokens.js.map +1 -1
- package/dist/commands/device_groups.js +7 -6
- package/dist/commands/device_groups.js.map +1 -1
- package/dist/commands/feedback.js +5 -4
- package/dist/commands/feedback.js.map +1 -1
- package/dist/commands/releases.js +59 -11
- package/dist/commands/releases.js.map +1 -1
- package/dist/commands/store_listing.d.ts +95 -0
- package/dist/commands/store_listing.js +400 -0
- package/dist/commands/store_listing.js.map +1 -0
- package/dist/commands/testflight.js +4 -3
- package/dist/commands/testflight.js.map +1 -1
- package/dist/commands/webhooks.js +6 -5
- package/dist/commands/webhooks.js.map +1 -1
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/dist/lib/json_output.d.ts +18 -0
- package/dist/lib/json_output.js +22 -0
- package/dist/lib/json_output.js.map +1 -0
- package/package.json +1 -1
package/dist/commands/agc.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { apiRequest } from "../lib/api.js";
|
|
2
|
+
import { jsonRequested } from "../lib/json_output.js";
|
|
2
3
|
/**
|
|
3
4
|
* `hands agc …` — AppGallery Connect invitation testing for OHOS builds
|
|
4
5
|
* (Huawei App Testing, releaseType 6). Store listing / phased release is not
|
|
@@ -7,7 +8,7 @@ import { apiRequest } from "../lib/api.js";
|
|
|
7
8
|
*/
|
|
8
9
|
export function registerAgcCommands(program) {
|
|
9
10
|
const agc = program.command("agc").description("AppGallery Connect packages and invitation testing for HarmonyOS builds.");
|
|
10
|
-
const wantsJson = (opts) => Boolean(opts.json || program.opts().json);
|
|
11
|
+
const wantsJson = (opts) => Boolean(jsonRequested(program, opts.json) || program.opts().json);
|
|
11
12
|
agc
|
|
12
13
|
.command("upload-market <appIdOrSlug> <buildId>")
|
|
13
14
|
.description("Upload a signed HarmonyOS .app to AppGallery formal package management; does not submit review.")
|
package/dist/commands/agc.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"agc.js","sourceRoot":"","sources":["../../src/commands/agc.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"agc.js","sourceRoot":"","sources":["../../src/commands/agc.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAiBtD;;;;;GAKG;AACH,MAAM,UAAU,mBAAmB,CAAC,OAAgB;IAClD,MAAM,GAAG,GAAG,OAAO,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,WAAW,CAAC,0EAA0E,CAAC,CAAC;IAC3H,MAAM,SAAS,GAAG,CAAC,IAAwB,EAAE,EAAE,CAAC,OAAO,CAAC,aAAa,CAAC,OAAO,EAAE,IAAI,CAAC,IAAI,CAAC,IAAI,OAAO,CAAC,IAAI,EAAsB,CAAC,IAAI,CAAC,CAAC;IAEtI,GAAG;SACA,OAAO,CAAC,uCAAuC,CAAC;SAChD,WAAW,CAAC,iGAAiG,CAAC;SAC9G,cAAc,CAAC,uBAAuB,EAAE,wBAAwB,CAAC;SACjE,MAAM,CAAC,QAAQ,EAAE,cAAc,EAAE,KAAK,CAAC;SACvC,MAAM,CAAC,KAAK,EAAE,GAAW,EAAE,OAAe,EAAE,IAA6C,EAAE,EAAE;QAC5F,MAAM,KAAK,GAAG,MAAM,YAAY,CAAC,GAAG,CAAC,CAAC;QACtC,MAAM,MAAM,GAAG,MAAM,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B,CAAC;AAED,KAAK,UAAU,YAAY,CAAC,KAAa;IACvC,IAAI,+BAA+B,CAAC,IAAI,CAAC,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IAC9D,MAAM,EAAE,IAAI,EAAE,GAAG,MAAM,UAAU,CAAqB,WAAW,CAAC,CAAC;IACnE,MAAM,GAAG,GAAG,IAAI,CAAC,IAAI,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC;IACrD,IAAI,CAAC,GAAG;QAAE,MAAM,IAAI,KAAK,CAAC,kBAAkB,KAAK,EAAE,CAAC,CAAC;IACrD,OAAO,GAAG,CAAC,EAAE,CAAC;AAChB,CAAC"}
|
package/dist/commands/apps.js
CHANGED
|
@@ -5,6 +5,7 @@
|
|
|
5
5
|
* app-admin-only client-key read endpoint.
|
|
6
6
|
*/
|
|
7
7
|
import { apiRequest } from "../lib/api.js";
|
|
8
|
+
import { jsonRequested } from "../lib/json_output.js";
|
|
8
9
|
export function registerAppCommands(program) {
|
|
9
10
|
const apps = program.command("apps").description("Manage apps in your org.");
|
|
10
11
|
apps
|
|
@@ -27,7 +28,7 @@ export function registerAppCommands(program) {
|
|
|
27
28
|
: {}),
|
|
28
29
|
},
|
|
29
30
|
});
|
|
30
|
-
if (opts.json) {
|
|
31
|
+
if (jsonRequested(program, opts.json)) {
|
|
31
32
|
console.log(JSON.stringify(app, null, 2));
|
|
32
33
|
return;
|
|
33
34
|
}
|
|
@@ -45,7 +46,7 @@ export function registerAppCommands(program) {
|
|
|
45
46
|
const res = await apiRequest("/api/apps", {
|
|
46
47
|
query: { include_archived: opts.includeArchived ? "1" : "0" },
|
|
47
48
|
});
|
|
48
|
-
if (opts.json) {
|
|
49
|
+
if (jsonRequested(program, opts.json)) {
|
|
49
50
|
console.log(JSON.stringify(res, null, 2));
|
|
50
51
|
return;
|
|
51
52
|
}
|
|
@@ -71,7 +72,7 @@ export function registerAppCommands(program) {
|
|
|
71
72
|
.action(async (appIdOrSlug, opts) => {
|
|
72
73
|
const id = await resolveAppId(appIdOrSlug);
|
|
73
74
|
const app = await apiRequest(`/api/apps/${id}`);
|
|
74
|
-
if (opts.json) {
|
|
75
|
+
if (jsonRequested(program, opts.json)) {
|
|
75
76
|
console.log(JSON.stringify(app, null, 2));
|
|
76
77
|
return;
|
|
77
78
|
}
|
|
@@ -88,7 +89,7 @@ export function registerAppCommands(program) {
|
|
|
88
89
|
.action(async (appIdOrSlug, opts) => {
|
|
89
90
|
const appId = await resolveAppId(appIdOrSlug);
|
|
90
91
|
const result = await apiRequest(`/api/apps/${appId}/client-key`);
|
|
91
|
-
if (opts.json) {
|
|
92
|
+
if (jsonRequested(program, opts.json)) {
|
|
92
93
|
console.log(JSON.stringify(result, null, 2));
|
|
93
94
|
return;
|
|
94
95
|
}
|
|
@@ -112,7 +113,7 @@ export function registerAppCommands(program) {
|
|
|
112
113
|
method: "POST",
|
|
113
114
|
body: { account_id: accountId, app_role: role },
|
|
114
115
|
});
|
|
115
|
-
if (opts.json) {
|
|
116
|
+
if (jsonRequested(program, opts.json)) {
|
|
116
117
|
console.log(JSON.stringify(result, null, 2));
|
|
117
118
|
return;
|
|
118
119
|
}
|
|
@@ -125,7 +126,7 @@ export function registerAppCommands(program) {
|
|
|
125
126
|
.action(async (appIdOrSlug, accountId, role, opts) => {
|
|
126
127
|
const appId = await resolveAppId(appIdOrSlug);
|
|
127
128
|
const result = await apiRequest(`/api/apps/${appId}/members/${accountId}`, { method: "PATCH", body: { app_role: role } });
|
|
128
|
-
if (opts.json) {
|
|
129
|
+
if (jsonRequested(program, opts.json)) {
|
|
129
130
|
console.log(JSON.stringify(result, null, 2));
|
|
130
131
|
return;
|
|
131
132
|
}
|
|
@@ -138,7 +139,7 @@ export function registerAppCommands(program) {
|
|
|
138
139
|
.action(async (appIdOrSlug, accountId, opts) => {
|
|
139
140
|
const appId = await resolveAppId(appIdOrSlug);
|
|
140
141
|
const result = await apiRequest(`/api/apps/${appId}/members/${accountId}`, { method: "DELETE" });
|
|
141
|
-
if (opts.json) {
|
|
142
|
+
if (jsonRequested(program, opts.json)) {
|
|
142
143
|
console.log(JSON.stringify(result, null, 2));
|
|
143
144
|
return;
|
|
144
145
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"apps.js","sourceRoot":"","sources":["../../src/commands/apps.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;
|
|
1
|
+
{"version":3,"file":"apps.js","sourceRoot":"","sources":["../../src/commands/apps.ts"],"names":[],"mappings":"AAAA;;;;;GAKG;AAGH,OAAO,EAAE,UAAU,EAAE,MAAM,eAAe,CAAC;AAC3C,OAAO,EAAE,aAAa,EAAE,MAAM,uBAAuB,CAAC;AAyBtD,MAAM,UAAU,mBAAmB,CAAC,OAAgB;IAClD,MAAM,IAAI,GAAG,OAAO,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,WAAW,CAAC,0BAA0B,CAAC,CAAC;IAE7E,IAAI;SACD,OAAO,CAAC,QAAQ,CAAC;SACjB,WAAW,CAAC,kDAAkD,CAAC;SAC/D,cAAc,CAAC,eAAe,EAAE,kBAAkB,CAAC;SACnD,cAAc,CAAC,eAAe,EAAE,eAAe,CAAC;SAChD,cAAc,CACb,uBAAuB,EACvB,uEAAuE,CACxE;SACA,MAAM,CAAC,sBAAsB,EAAE,2BAA2B,CAAC;SAC3D,MAAM,CAAC,QAAQ,EAAE,cAAc,EAAE,KAAK,CAAC;SACvC,MAAM,CAAC,KAAK,EAAE,IAMd,EAAE,EAAE;QACH,MAAM,GAAG,GAAG,MAAM,UAAU,CAAa,WAAW,EAAE;YACpD,MAAM,EAAE,MAAM;YACd,IAAI,EAAE;gBACJ,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,IAAI,EAAE,IAAI,CAAC,IAAI;gBACf,QAAQ,EAAE,IAAI,CAAC,QAAQ;gBACvB,GAAG,CAAC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C,IAAI,CAAC,IAAI,CAAC,CAAC,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,IAAI,KAAK,KAAK,CAAC,CAAC;IACzD,IAAI,CAAC,KAAK;QAAE,MAAM,IAAI,KAAK,CAAC,qBAAqB,KAAK,IAAI,CAAC,CAAC;IAC5D,OAAO,KAAK,CAAC,EAAE,CAAC;AAClB,CAAC;AAED,SAAS,eAAe,CAAC,CAAS;IAChC,OAAO,CAAC,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,MAAM,KAAK,CAAC,CAAC;AACnC,CAAC"}
|
package/dist/commands/builds.js
CHANGED
|
@@ -15,6 +15,7 @@ import { promisify } from "node:util";
|
|
|
15
15
|
import { createGunzip } from "node:zlib";
|
|
16
16
|
import { apiRequest, apiUploadFile, QuiverApiError } from "../lib/api.js";
|
|
17
17
|
import { createHash } from "node:crypto";
|
|
18
|
+
import { jsonRequested } from "../lib/json_output.js";
|
|
18
19
|
const execFileAsync = promisify(execFile);
|
|
19
20
|
/**
|
|
20
21
|
* Digest and byte length of a local file, streamed so a multi-hundred-megabyte
|
|
@@ -399,7 +400,7 @@ export function registerBuildCommands(program) {
|
|
|
399
400
|
.action(async (appIdOrSlug, opts) => {
|
|
400
401
|
const id = await resolveAppId(appIdOrSlug);
|
|
401
402
|
const res = await apiRequest(`/api/apps/${id}/builds`, { query: { limit: opts.limit } });
|
|
402
|
-
if (shouldOutputJson(program, opts.json)) {
|
|
403
|
+
if (shouldOutputJson(program, jsonRequested(program, opts.json))) {
|
|
403
404
|
console.log(JSON.stringify(res, null, 2));
|
|
404
405
|
return;
|
|
405
406
|
}
|
|
@@ -419,7 +420,7 @@ export function registerBuildCommands(program) {
|
|
|
419
420
|
.action(async (appIdOrSlug, buildId, opts) => {
|
|
420
421
|
const id = await resolveAppId(appIdOrSlug);
|
|
421
422
|
const build = await apiRequest(`/api/apps/${id}/builds/${buildId}`);
|
|
422
|
-
if (shouldOutputJson(program, opts.json)) {
|
|
423
|
+
if (shouldOutputJson(program, jsonRequested(program, opts.json))) {
|
|
423
424
|
console.log(JSON.stringify(build, null, 2));
|
|
424
425
|
return;
|
|
425
426
|
}
|
|
@@ -444,7 +445,7 @@ export function registerBuildCommands(program) {
|
|
|
444
445
|
.action(async (appIdOrSlug, buildId, assetId, opts) => {
|
|
445
446
|
const id = await resolveAppId(appIdOrSlug);
|
|
446
447
|
const result = await apiRequest(`/api/apps/${id}/builds/${buildId}/assets/${assetId}/download?presign=1`);
|
|
447
|
-
if (shouldOutputJson(program, opts.json)) {
|
|
448
|
+
if (shouldOutputJson(program, jsonRequested(program, opts.json))) {
|
|
448
449
|
console.log(JSON.stringify(result, null, 2));
|
|
449
450
|
return;
|
|
450
451
|
}
|
|
@@ -459,12 +460,95 @@ export function registerBuildCommands(program) {
|
|
|
459
460
|
.action(async (appIdOrSlug, buildId, assetId, opts) => {
|
|
460
461
|
const id = await resolveAppId(appIdOrSlug);
|
|
461
462
|
const result = await apiRequest(`/api/apps/${id}/builds/${buildId}/assets/${assetId}`, { method: "DELETE" });
|
|
462
|
-
if (shouldOutputJson(program, opts.json)) {
|
|
463
|
+
if (shouldOutputJson(program, jsonRequested(program, opts.json))) {
|
|
463
464
|
console.log(JSON.stringify(result, null, 2));
|
|
464
465
|
return;
|
|
465
466
|
}
|
|
466
467
|
console.log(`Deleted asset ${assetId} from build ${buildId}.`);
|
|
467
468
|
});
|
|
469
|
+
/**
|
|
470
|
+
* GET /builds/:buildId returns the build object directly. Some Hands surfaces
|
|
471
|
+
* wrap it as { build: {...} }, so accept both: an assumed wrapper silently
|
|
472
|
+
* yields a report of nulls, which reads as a successful empty result rather
|
|
473
|
+
* than an error -- the failure mode this helper exists to prevent.
|
|
474
|
+
*/
|
|
475
|
+
async function readBuild(appId, buildId) {
|
|
476
|
+
const detail = await apiRequest(`/api/apps/${appId}/builds/${buildId}`);
|
|
477
|
+
const unwrapped = detail.build;
|
|
478
|
+
if (unwrapped && typeof unwrapped === "object") {
|
|
479
|
+
return unwrapped;
|
|
480
|
+
}
|
|
481
|
+
return detail;
|
|
482
|
+
}
|
|
483
|
+
/**
|
|
484
|
+
* What is about to be deleted, recorded before the delete rather than after:
|
|
485
|
+
* once the row is gone the success message is the only trace, and "it had no
|
|
486
|
+
* releases and no assets" says nothing about which build disappeared.
|
|
487
|
+
*/
|
|
488
|
+
function describeBuild(buildId, build) {
|
|
489
|
+
const assets = Array.isArray(build.assets) ? build.assets : [];
|
|
490
|
+
return {
|
|
491
|
+
build_id: buildId,
|
|
492
|
+
status: build.status ?? null,
|
|
493
|
+
version_name: build.version_name ?? null,
|
|
494
|
+
version_code: build.version_code ?? null,
|
|
495
|
+
asset_count: Number(build.asset_count ?? assets.length),
|
|
496
|
+
asset_sha256: assets
|
|
497
|
+
.map((asset) => asset.sha256)
|
|
498
|
+
.filter((value) => typeof value === "string"),
|
|
499
|
+
checked: "server enforces: no releases referencing this build, no assets attached",
|
|
500
|
+
};
|
|
501
|
+
}
|
|
502
|
+
function formatBuildRecord(build) {
|
|
503
|
+
const lines = [
|
|
504
|
+
`Build ${build.build_id}:`,
|
|
505
|
+
` status=${String(build.status)}`,
|
|
506
|
+
` version=${String(build.version_name)} (${String(build.version_code)})`,
|
|
507
|
+
];
|
|
508
|
+
if (typeof build.asset_count === "number") {
|
|
509
|
+
lines.push(` assets=${build.asset_count}`);
|
|
510
|
+
}
|
|
511
|
+
for (const sha of build.asset_sha256 ?? [])
|
|
512
|
+
lines.push(` asset sha256=${sha}`);
|
|
513
|
+
return lines.join("\n");
|
|
514
|
+
}
|
|
515
|
+
builds
|
|
516
|
+
.command("delete <appIdOrSlug> <buildId>")
|
|
517
|
+
.description("Delete a build that has never been released and has no assets. " +
|
|
518
|
+
"Requires app admin. Hands refuses (409) while any release references the build " +
|
|
519
|
+
"or any asset is attached, so this can only remove a build that never shipped -- " +
|
|
520
|
+
"a test leftover, not a release record.")
|
|
521
|
+
.option("--json", "Output JSON.", false)
|
|
522
|
+
.option("--dry-run", "Check whether the build can be deleted without deleting it.", false)
|
|
523
|
+
.action(async (appIdOrSlug, buildId, opts) => {
|
|
524
|
+
const id = await resolveAppId(appIdOrSlug);
|
|
525
|
+
const asJson = shouldOutputJson(program, jsonRequested(program, opts.json));
|
|
526
|
+
if (opts.dryRun) {
|
|
527
|
+
// Read the build so the refusal reasons can be reported before anyone
|
|
528
|
+
// commits to the delete: a 409 later is far less useful than knowing
|
|
529
|
+
// up front which condition blocks it.
|
|
530
|
+
const build = await readBuild(id, buildId);
|
|
531
|
+
const report = describeBuild(buildId, build);
|
|
532
|
+
if (asJson) {
|
|
533
|
+
console.log(JSON.stringify(report, null, 2));
|
|
534
|
+
return;
|
|
535
|
+
}
|
|
536
|
+
console.log(formatBuildRecord(report));
|
|
537
|
+
console.log("A delete would be refused if any release references it or any asset is attached.");
|
|
538
|
+
return;
|
|
539
|
+
}
|
|
540
|
+
// Record what is being removed BEFORE removing it: afterwards this
|
|
541
|
+
// message is the only evidence of which build disappeared.
|
|
542
|
+
const before = describeBuild(buildId, await readBuild(id, buildId));
|
|
543
|
+
const result = await apiRequest(`/api/apps/${id}/builds/${buildId}`, { method: "DELETE" });
|
|
544
|
+
if (asJson) {
|
|
545
|
+
console.log(JSON.stringify({ deleted: before, result }, null, 2));
|
|
546
|
+
return;
|
|
547
|
+
}
|
|
548
|
+
console.log(`Deleting build of ${appIdOrSlug}:`);
|
|
549
|
+
console.log(formatBuildRecord(before));
|
|
550
|
+
console.log(`Deleted build ${buildId}. It had no releases and no assets, so no release record referenced it.`);
|
|
551
|
+
});
|
|
468
552
|
builds
|
|
469
553
|
.command("publish-version <appIdOrSlug>")
|
|
470
554
|
.description("Register an immutable externally hosted Node/CLI build target.")
|
|
@@ -523,7 +607,7 @@ export function registerBuildCommands(program) {
|
|
|
523
607
|
},
|
|
524
608
|
},
|
|
525
609
|
});
|
|
526
|
-
if (shouldOutputJson(program, opts.json)) {
|
|
610
|
+
if (shouldOutputJson(program, jsonRequested(program, opts.json))) {
|
|
527
611
|
console.log(JSON.stringify(result, null, 2));
|
|
528
612
|
return;
|
|
529
613
|
}
|
|
@@ -723,7 +807,7 @@ export function registerBuildCommands(program) {
|
|
|
723
807
|
size_bytes: asset.size_bytes,
|
|
724
808
|
})),
|
|
725
809
|
};
|
|
726
|
-
if (shouldOutputJson(program, opts.json)) {
|
|
810
|
+
if (shouldOutputJson(program, jsonRequested(program, opts.json))) {
|
|
727
811
|
console.log(JSON.stringify(result, null, 2));
|
|
728
812
|
return;
|
|
729
813
|
}
|
|
@@ -934,7 +1018,7 @@ export function registerBuildCommands(program) {
|
|
|
934
1018
|
version_code: versionCode,
|
|
935
1019
|
assets,
|
|
936
1020
|
};
|
|
937
|
-
if (shouldOutputJson(program, opts.json)) {
|
|
1021
|
+
if (shouldOutputJson(program, jsonRequested(program, opts.json))) {
|
|
938
1022
|
console.log(JSON.stringify(result, null, 2));
|
|
939
1023
|
return;
|
|
940
1024
|
}
|
|
@@ -1081,7 +1165,7 @@ export function registerBuildCommands(program) {
|
|
|
1081
1165
|
version_code: versionCode,
|
|
1082
1166
|
assets,
|
|
1083
1167
|
};
|
|
1084
|
-
if (shouldOutputJson(program, opts.json)) {
|
|
1168
|
+
if (shouldOutputJson(program, jsonRequested(program, opts.json))) {
|
|
1085
1169
|
console.log(JSON.stringify(result, null, 2));
|
|
1086
1170
|
return;
|
|
1087
1171
|
}
|
|
@@ -1116,7 +1200,7 @@ export function registerBuildCommands(program) {
|
|
|
1116
1200
|
arch: null,
|
|
1117
1201
|
filetype: SYMBOL_FILETYPE[kind] ?? "mapping.txt",
|
|
1118
1202
|
});
|
|
1119
|
-
if (shouldOutputJson(program, opts.json)) {
|
|
1203
|
+
if (shouldOutputJson(program, jsonRequested(program, opts.json))) {
|
|
1120
1204
|
console.log(JSON.stringify(asset, null, 2));
|
|
1121
1205
|
return;
|
|
1122
1206
|
}
|
|
@@ -1132,7 +1216,7 @@ export function registerBuildCommands(program) {
|
|
|
1132
1216
|
const result = await apiRequest(`/api/apps/${appId}/builds/${buildId}/testflight-groups`, {
|
|
1133
1217
|
query: { bundle_id: opts.bundleId },
|
|
1134
1218
|
});
|
|
1135
|
-
if (shouldOutputJson(program, opts.json)) {
|
|
1219
|
+
if (shouldOutputJson(program, jsonRequested(program, opts.json))) {
|
|
1136
1220
|
console.log(JSON.stringify(result, null, 2));
|
|
1137
1221
|
return;
|
|
1138
1222
|
}
|
|
@@ -1160,7 +1244,7 @@ export function registerBuildCommands(program) {
|
|
|
1160
1244
|
}
|
|
1161
1245
|
const appId = await resolveAppId(appIdOrSlug);
|
|
1162
1246
|
const status = await getTestflightPublishStatus(appId, buildId, opts);
|
|
1163
|
-
if (shouldOutputJson(program, opts.json)) {
|
|
1247
|
+
if (shouldOutputJson(program, jsonRequested(program, opts.json))) {
|
|
1164
1248
|
console.log(JSON.stringify(status, null, 2));
|
|
1165
1249
|
return;
|
|
1166
1250
|
}
|
|
@@ -1200,7 +1284,7 @@ export function registerBuildCommands(program) {
|
|
|
1200
1284
|
const appId = await resolveAppId(appIdOrSlug);
|
|
1201
1285
|
const intervalSeconds = positiveSeconds(opts.pollIntervalSeconds, "--poll-interval-seconds");
|
|
1202
1286
|
const timeoutSeconds = positiveSeconds(opts.timeoutSeconds, "--timeout-seconds");
|
|
1203
|
-
const quiet = shouldOutputJson(program, opts.json);
|
|
1287
|
+
const quiet = shouldOutputJson(program, jsonRequested(program, opts.json));
|
|
1204
1288
|
const distribution = opts.distribution;
|
|
1205
1289
|
const waitStartedAt = Date.now();
|
|
1206
1290
|
if (opts.wait) {
|
|
@@ -1413,7 +1497,7 @@ export function registerBuildCommands(program) {
|
|
|
1413
1497
|
version_code: versionCode,
|
|
1414
1498
|
assets,
|
|
1415
1499
|
};
|
|
1416
|
-
if (shouldOutputJson(program, opts.json)) {
|
|
1500
|
+
if (shouldOutputJson(program, jsonRequested(program, opts.json))) {
|
|
1417
1501
|
console.log(JSON.stringify(result, null, 2));
|
|
1418
1502
|
return;
|
|
1419
1503
|
}
|
|
@@ -1576,7 +1660,7 @@ export function registerBuildCommands(program) {
|
|
|
1576
1660
|
version_code: versionCode,
|
|
1577
1661
|
assets,
|
|
1578
1662
|
};
|
|
1579
|
-
if (shouldOutputJson(program, opts.json)) {
|
|
1663
|
+
if (shouldOutputJson(program, jsonRequested(program, opts.json))) {
|
|
1580
1664
|
console.log(JSON.stringify(result, null, 2));
|
|
1581
1665
|
return;
|
|
1582
1666
|
}
|
|
@@ -1652,6 +1736,34 @@ function inferSymbolKind(filePath) {
|
|
|
1652
1736
|
function inferSymbolPlatform(filePath) {
|
|
1653
1737
|
return inferSymbolKind(filePath) === "proguard-mapping" ? "android" : "ios";
|
|
1654
1738
|
}
|
|
1739
|
+
/**
|
|
1740
|
+
* POST the completion step, retrying transient transport failures.
|
|
1741
|
+
*
|
|
1742
|
+
* Safe because the endpoint is a replay when the asset is already committed
|
|
1743
|
+
* (build_asset_uploads.ts returns the stored row when state='ready'), so a retry
|
|
1744
|
+
* can only produce the same result. Bounded: three attempts with short backoff,
|
|
1745
|
+
* then surface the last error so a real failure is not hidden.
|
|
1746
|
+
*/
|
|
1747
|
+
async function completeWithRetry(appId, buildId, assetId) {
|
|
1748
|
+
const attempts = 3;
|
|
1749
|
+
let lastError;
|
|
1750
|
+
for (let attempt = 1; attempt <= attempts; attempt += 1) {
|
|
1751
|
+
try {
|
|
1752
|
+
return await apiRequest(`/api/apps/${appId}/builds/${buildId}/assets/${assetId}/upload/complete`, {
|
|
1753
|
+
method: "POST",
|
|
1754
|
+
});
|
|
1755
|
+
}
|
|
1756
|
+
catch (error) {
|
|
1757
|
+
lastError = error;
|
|
1758
|
+
const message = error instanceof Error ? error.message : String(error);
|
|
1759
|
+
const transient = /fetch failed|network|timeout|socket hang up|ECONNRESET|EAI_AGAIN/i.test(message);
|
|
1760
|
+
if (!transient || attempt === attempts)
|
|
1761
|
+
throw error;
|
|
1762
|
+
await new Promise((resolve) => setTimeout(resolve, 500 * attempt));
|
|
1763
|
+
}
|
|
1764
|
+
}
|
|
1765
|
+
throw lastError;
|
|
1766
|
+
}
|
|
1655
1767
|
async function uploadDirectBuildAsset(appId, buildId, filePath, metadata) {
|
|
1656
1768
|
const local = await sha256File(filePath);
|
|
1657
1769
|
const idempotencyKey = createHash("sha256").update(JSON.stringify({
|
|
@@ -1699,9 +1811,12 @@ async function uploadDirectBuildAsset(appId, buildId, filePath, metadata) {
|
|
|
1699
1811
|
throw new Error(`direct R2 upload failed: ${uploadResponse.status} ${uploadResponse.statusText}`);
|
|
1700
1812
|
}
|
|
1701
1813
|
}
|
|
1702
|
-
|
|
1703
|
-
|
|
1704
|
-
|
|
1814
|
+
// Completion is idempotent server-side: if the row is already 'ready' with a
|
|
1815
|
+
// committed key, the endpoint replays the stored result. So a transient network
|
|
1816
|
+
// failure here can be retried without risking a duplicate asset -- and NOT
|
|
1817
|
+
// retrying would report "fetch failed" for an upload that actually committed,
|
|
1818
|
+
// which is exactly what happened during the first real use of attach-symbols.
|
|
1819
|
+
const completed = await completeWithRetry(appId, buildId, declared.asset_id);
|
|
1705
1820
|
return {
|
|
1706
1821
|
id: completed.asset_id,
|
|
1707
1822
|
artifact_kind: metadata.artifact_kind,
|