serve --stdio: desktop JSON-RPC profile on the MCP core, confirm tokens, --json results, sidecar builds
- cli/serve.ts: session.hello with a per-session secret, typed methods per tool, project.inspect, portfolio.status over many project folders, progress notifications, cancellation - cli/lib/confirm-token.ts: single-use HMAC tokens bound to method + canonical params + expiry; writes are dry runs without one; no submit / release / publish method exists - cli/lib/runner.ts: shared child runner for mcp and serve, works from a compiled binary - --json on check, testflight / ppo status, next-build, next-version-code, analytics compare, prices import; inspect command; confirm() always answers no under serve - tools/build-sidecars.ts: bun build --compile for five targets, ad-hoc re-sign on macOS, path leak check - tests/serve.test.ts: methods, token binding / expiry / replay, shared vector, stdio and compiled smoke
This commit is contained in:
parent
c6360812b8
commit
3454a9aadb
28 changed files with 1048 additions and 42 deletions
|
|
@ -1,5 +1,5 @@
|
|||
// TestFlight through the App Store Connect API.
|
||||
// storebound apple testflight status groups, testers per group, recent builds + beta states
|
||||
// storebound apple testflight status [--json] groups, testers per group, recent builds + beta states
|
||||
// storebound apple testflight groups [--dry] create the groups of apple.testflight.groups that are missing
|
||||
// storebound apple testflight testers [--csv f] [--group a,b] [--remove] [--invite] [--dry] [--yes]
|
||||
// storebound apple testflight what-to-test --build N [--version x.y.z] [--locale en-US,tr] [--text "..."] [--dry]
|
||||
|
|
@ -14,7 +14,7 @@ import { existsSync, readFileSync } from 'node:fs';
|
|||
import type { Ctx } from '../lib/ctx';
|
||||
import { confirm, need } from '../lib/ctx';
|
||||
import { reviewContact } from '../lib/credentials';
|
||||
import { done, log, warn } from '../lib/log';
|
||||
import { done, log, printJson, warn } from '../lib/log';
|
||||
import { textTable } from '../lib/table';
|
||||
import {
|
||||
type ApiBuild, betaDescriptions, betaReadiness, betaReviewReq, buildsWithVersion, type Group, groupFromApi, inviteReq, maskEmail,
|
||||
|
|
@ -52,21 +52,30 @@ export async function run(ctx: Ctx): Promise<void> {
|
|||
if (sub === 'status') {
|
||||
const gs = await groups(c, appId);
|
||||
const rows: (string | number)[][] = [];
|
||||
const jsonGroups: Record<string, unknown>[] = [];
|
||||
for (const g of gs) {
|
||||
const testers = await c.all(`/v1/betaGroups/${g.id}/betaTesters?limit=200`);
|
||||
const builds = await c.all(`/v1/betaGroups/${g.id}/builds?limit=200`);
|
||||
jsonGroups.push({ id: g.id, name: g.name, internal: g.internal, testers: testers.length, builds: g.internal && g.hasAccessToAllBuilds ? 'all' : builds.length, publicLink: !!g.publicLinkEnabled });
|
||||
rows.push([g.name, g.internal ? 'internal' : 'external', testers.length, g.internal && g.hasAccessToAllBuilds ? 'all' : builds.length, g.publicLinkEnabled ? 'public link on' : '']);
|
||||
}
|
||||
console.log(textTable(['group', 'kind', 'testers', 'builds', ''], rows));
|
||||
const q = new URLSearchParams({ 'filter[app]': appId, include: 'preReleaseVersion,buildBetaDetail', sort: '-uploadedDate', limit: '8' });
|
||||
const resp = await c.asc('GET', `/v1/builds?${q}`);
|
||||
const details = new Map((resp.included ?? []).filter((x: J) => x.type === 'buildBetaDetails').map((x: J) => [x.id, x.attributes] as const));
|
||||
const missingGroups = (tf?.groups ?? []).filter(w => !gs.some(g => g.name === w.name)).map(w => w.name);
|
||||
if (a.has('json')) {
|
||||
printJson({ groups: jsonGroups, builds: buildsWithVersion(resp).map(b => {
|
||||
const d = details.get((b as J).relationships?.buildBetaDetail?.data?.id) as J;
|
||||
return { version: b.marketing ?? null, build: b.attributes.version ?? null, processing: b.attributes.processingState ?? null, internal: d?.internalBuildState ?? null, external: d?.externalBuildState ?? null, uploaded: b.attributes.uploadedDate ?? null };
|
||||
}), missingGroups });
|
||||
return;
|
||||
}
|
||||
console.log(textTable(['group', 'kind', 'testers', 'builds', ''], rows));
|
||||
console.log('\n' + textTable(['version', 'build', 'processing', 'internal', 'external', 'uploaded'], buildsWithVersion(resp).map(b => {
|
||||
const d = details.get((b as J).relationships?.buildBetaDetail?.data?.id) as J;
|
||||
return [b.marketing ?? '', b.attributes.version ?? '', b.attributes.processingState ?? '', d?.internalBuildState ?? '', d?.externalBuildState ?? '', (b.attributes.uploadedDate ?? '').slice(0, 10)];
|
||||
})));
|
||||
const missing = (tf?.groups ?? []).filter(w => !gs.some(g => g.name === w.name)).map(w => w.name);
|
||||
if (missing.length) warn(TAG, `configured but not on App Store Connect: ${missing.join(', ')} (storebound apple testflight groups)`);
|
||||
if (missingGroups.length) warn(TAG, `configured but not on App Store Connect: ${missingGroups.join(', ')} (storebound apple testflight groups)`);
|
||||
return;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue