Review access and account deletion: demo account from .storebound (masked) to App Review, accounts config, profile checks in check and validate, Data safety extra rows

This commit is contained in:
CRTkafa 2026-10-10 17:47:08 +00:00
parent 1e57cfec27
commit 7e1d839d68
12 changed files with 578 additions and 21 deletions

View file

@ -1,11 +1,14 @@
// App Review information on the editable version: contact, demo account (none), notes. Idempotent.
// App Review information on the editable version: contact, demo account, notes. Idempotent.
// storebound apple review-details [--contact-from <Apple ID of another app>] [--dry]
// The contact (name, phone, email) is personal data, so it is never in the config: it comes from
// .storebound/credentials.json "reviewContact", or is copied from another app of the same team with --contact-from.
// Notes: apple.info.reviewNotes in storebound.config.ts.
// Demo account (reviewAccess.signInRequired: true): "reviewDemoAccount" in .storebound/credentials.json or
// REVIEW_DEMO_USER / REVIEW_DEMO_PASSWORD; masked in every log line. Notes: apple.info.reviewNotes plus
// reviewAccess.instructions and accounts.inApp (lib/review-details.ts).
import type { Ctx } from '../lib/ctx';
import { need } from '../lib/ctx';
import { reviewContact } from '../lib/credentials';
import { reviewContact, reviewDemoAccount } from '../lib/credentials';
import { reviewDetailPlan } from '../lib/review-details';
import { done, log } from '../lib/log';
import { ascClient } from './asc';
@ -29,11 +32,11 @@ export async function run(ctx: Ctx): Promise<void> {
}
if (!contact) throw new Error('no review contact: add "reviewContact" to .storebound/credentials.json or pass --contact-from <app id>');
const attributes = { ...contact, demoAccountRequired: false, demoAccountName: null, demoAccountPassword: null, notes: config.apple?.info?.reviewNotes ?? '' };
if (ctx.args.has('dry')) { log('apple', `would set review details (contact ${from ? 'copied from ' + from : 'from credentials'}, notes ${attributes.notes.length} chars)`); return; }
const { attributes, summary } = reviewDetailPlan(config, contact, reviewDemoAccount(root));
if (ctx.args.has('dry')) { log('apple', `would set review details (contact ${from ? 'copied from ' + from : 'from credentials'}, ${summary})`); return; }
const cur = (await c.maybe(`/v1/appStoreVersions/${version.id}/appStoreReviewDetail`))?.data;
if (cur) await c.asc('PATCH', `/v1/appStoreReviewDetails/${cur.id}`, { data: { type: 'appStoreReviewDetails', id: cur.id, attributes } });
else await c.asc('POST', '/v1/appStoreReviewDetails', { data: { type: 'appStoreReviewDetails', attributes,
relationships: { appStoreVersion: { data: { type: 'appStoreVersions', id: version.id } } } } });
done('apple', `review details set on ${version.attributes.versionString} (no demo account, notes ${attributes.notes.length} chars)`);
done('apple', `review details set on ${version.attributes.versionString} (${summary})`);
}