Updates are agent steps: --yes ships an update of a live app (Play production, App Store submit / release) without an owner gate; the first release stays the owner's (exit 3 OWNER_STEP, --first-release); apple release is a ship step

This commit is contained in:
CRTkafa 2026-10-26 18:09:50 +07:00
parent c247b7e54a
commit ae9d26d3f6
28 changed files with 562 additions and 44 deletions

View file

@ -29,10 +29,11 @@ export const SHIP_STEPS: Record<string, { step: string; store: 'apple' | 'play'
'apple upload': { step: 'upload', store: 'apple' },
'apple submit': { step: 'submit', store: 'apple' },
'apple resubmit': { step: 'resubmit', store: 'apple' },
'apple release': { step: 'release', store: 'apple' },
};
/** error.code of an exit 3: what the owner has to do. */
export const OWNER_CODES = ['AGREEMENT_PENDING', 'SIGN_IN_REQUIRED', 'COMPLIANCE_ANSWER_MISSING', 'CONSOLE_STEP', 'CONFIRMATION_REQUIRED'] as const;
export const OWNER_CODES = ['AGREEMENT_PENDING', 'SIGN_IN_REQUIRED', 'COMPLIANCE_ANSWER_MISSING', 'CONSOLE_STEP', 'CONFIRMATION_REQUIRED', 'OWNER_STEP'] as const;
export interface ShipErrorInfo { code: string; message: string; consoleUrl?: string }
export interface ShipResult {
@ -155,13 +156,14 @@ export function fieldsFromDetail(key: string, d: unknown): Fields {
const b = x.build as { number?: string } | undefined;
return { version: str(v?.versionString), build: str(b?.number), state: dry ? 'planned' : 'WAITING_FOR_REVIEW' };
}
case 'apple release': return { version: str(x.version), state: dry ? 'planned' : str(x.state) };
default: return {};
}
}
const DEFAULT_URL: Record<string, ConsolePage> = {
'play build': 'play.bundle-explorer', 'play upload': 'play.releases', 'play release': 'play.releases',
'apple build': 'asc.testflight', 'apple upload': 'asc.testflight', 'apple submit': 'asc.app-review', 'apple resubmit': 'asc.app-review',
'apple build': 'asc.testflight', 'apple upload': 'asc.testflight', 'apple submit': 'asc.app-review', 'apple resubmit': 'asc.app-review', 'apple release': 'asc.version',
};
/** The final result: the contract keys, then the command's own --json fields that do not clash with them (so readers
@ -297,6 +299,7 @@ const VERSION_FLAGS: Record<string, { version?: string; build?: string; intBuild
'apple upload': { build: 'build' },
'apple submit': { version: 'version', build: 'build' },
'apple resubmit': { version: 'version', build: 'build' },
'apple release': { version: 'version' },
};
/** The argv with the flags of --version-from added (a flag given by hand must agree with the file). */