template compliance answers never reach a store: init writes unanswered (dataSafety, appPrivacy, reviewNotes, ageRating, accounts, reviewAccess), older configs are recognised by the template values; check / validate / scan block, play data-safety (also --dry), console plan / fill, apple review-details and appinfo refuse. onboard --declarations replaces them on a live app: name and copyright from the stores (a copyright with a private term is left out), the rows the code proves (scan proposal, sign-up methods from auth code and login SDKs), the rest as one owner question list. play data-safety --dry prints the answers that change (old -> new, account and deletion first) against the last uploaded CSV; pitfall 60; tests
This commit is contained in:
parent
34c2fa22e5
commit
7219ded3e8
27 changed files with 659 additions and 19 deletions
|
|
@ -263,3 +263,25 @@ export function dataSafetyProblem(rows: string[][]): string | null {
|
|||
const i = dataSafetyIssues(rows);
|
||||
return i.length ? `Data safety CSV is not complete (Play would answer 400):\n${i.map(x => ` - ${x.msg}`).join('\n')}` : null;
|
||||
}
|
||||
|
||||
export interface DataSafetyChange { question: string; response: string; label: string; from: string; to: string }
|
||||
|
||||
/**
|
||||
* The answers that change between two Data safety CSVs (Play cannot read the form back, so `before` is the CSV this
|
||||
* project uploaded last; null = nothing recorded, every answer is new). One entry per (question, response) whose value
|
||||
* differs; a removed answer shows as old -> (empty). Pure.
|
||||
*/
|
||||
export function dataSafetyDiff(before: string | null, rows: string[][]): DataSafetyChange[] {
|
||||
type V = { q: string; r: string; v: string; label: string };
|
||||
const vals = (rs: string[][]) => new Map<string, V>(rs.slice(1).filter(r => r[0]).map(r => [pairKey(r[0]!, r[1] ?? ''), { q: r[0]!, r: r[1] ?? '', v: r[2] ?? '', label: (r[4] ?? '').trim() }]));
|
||||
const old = before ? vals(parseCsv(before)) : new Map<string, V>();
|
||||
const cur = vals(rows);
|
||||
const out: DataSafetyChange[] = [];
|
||||
for (const k of new Set([...old.keys(), ...cur.keys()])) {
|
||||
const o = old.get(k), n = cur.get(k);
|
||||
if ((o?.v ?? '') === (n?.v ?? '')) continue;
|
||||
const x = (n ?? o)!;
|
||||
out.push({ question: x.q, response: x.r, label: x.label || (formRow(x.q, x.r)?.label ?? ''), from: o?.v ?? '', to: n?.v ?? '' });
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue