Merge store-ops: TestFlight wait / expire, IAP review submissions, pulls, offers, CPP, events, reports, triage, ASO rank, ads scan
Conflicts resolved for both sides: - cli/lib/plist.ts, cli/lib/zip.ts: one implementation each. plist reads XML (text or bytes, attributes tolerated) and binary plists; ads scan now reads bytes, so a binary Info.plist works too. zip gains unzip() for the Play report exports on top of zipEntries / zipRead. - apple upload waits with testflight wait's loop (waitForBuild) instead of its own copy; BUILD_DONE removed. - config, credentials (profiles, keystore, ASC_VENDOR_NUMBER, now also a profile key), command table, MCP tools, credentials template, README, CHANGELOG: union. - MCP: --write stays forbidden; the three pull tools are the listed local-file exception (LOCAL_WRITE_TOOLS), so scan --write remains unreachable. - Adapters and API coverage tables regenerated.
This commit is contained in:
commit
b724cd4043
60 changed files with 4500 additions and 183 deletions
|
|
@ -6,11 +6,15 @@
|
|||
// Listings: title, short and full description of every `<!-- play: ... -->` section of the listing file, plus the promo
|
||||
// video (play.video, a YouTube URL) on every language. Play has no video upload: make the video with
|
||||
// `storebound shots video --target youtube`, upload it to YouTube (public or unlisted, ads off, embeddable), paste the URL.
|
||||
import { readFileSync } from 'node:fs';
|
||||
// And the other way round (read-only on Play, one throwaway edit that is deleted):
|
||||
// storebound play listing pull [--write] [--json] live listings -> diff -> (with --write) the Play listing file
|
||||
import { existsSync, readFileSync, writeFileSync } from 'node:fs';
|
||||
import { parsePlayListing } from '../lib/copy';
|
||||
import { compactDiff } from '../lib/diff';
|
||||
import { mergePlayListing, overLimits } from '../lib/listing-pull';
|
||||
import type { Ctx } from '../lib/ctx';
|
||||
import { need } from '../lib/ctx';
|
||||
import { done, log, step } from '../lib/log';
|
||||
import { done, log, printJson, step, warn } from '../lib/log';
|
||||
import { playClient } from './client';
|
||||
|
||||
export function readPlayCopy(ctx: Ctx) {
|
||||
|
|
@ -47,8 +51,33 @@ export function detailsChanges(current: Record<string, string | undefined>, want
|
|||
return Object.keys(wanted).filter(k => (current[k] ?? '') !== (wanted[k] ?? ''));
|
||||
}
|
||||
|
||||
async function pull(ctx: Ctx): Promise<void> {
|
||||
const { config, root, resolve } = ctx.loaded;
|
||||
const a = ctx.args;
|
||||
const play = await playClient(root, need(config.play?.packageName, 'play.packageName'));
|
||||
const now = await play.read(async id => (await play.call<{ listings?: PlayListing[] }>('GET', `${play.API}/edits/${id}/listings`)).listings ?? []);
|
||||
const file = resolve(config.play?.listing ?? 'store/listing.md');
|
||||
const before = existsSync(file) ? readFileSync(file, 'utf8') : '# Google Play listing copy\n\nPulled from Google Play by `storebound play listing pull`.\n';
|
||||
const r = mergePlayListing(before, now, config.app.name);
|
||||
const over = overLimits(r.changes, 'play');
|
||||
const diff = compactDiff(before, r.md);
|
||||
if (a.has('json')) printJson({ file, write: a.has('write') && !a.has('dry'), languages: now.map(l => l.language), changes: r.changes, added: r.added, conflicts: r.conflicts, overLimits: over, diff });
|
||||
else {
|
||||
log('play', `pull: ${now.length} listing(s) on Play`);
|
||||
for (const ch of r.changes) log('play', `${ch.section} ${ch.field}: ${ch.from === null ? 'new' : 'changed'}`);
|
||||
if (diff.length) console.log(diff.join('\n'));
|
||||
}
|
||||
for (const c of r.conflicts) warn('play', c);
|
||||
for (const o of over) warn('play', `over the limit on the store: ${o}`);
|
||||
if (!r.changes.length) { done('play', `${file} already matches the store`); return; }
|
||||
if (!a.has('write') || a.has('dry')) { done('play', `${r.changes.length} change(s); nothing written (add --write to update ${file})`); return; }
|
||||
writeFileSync(file, r.md);
|
||||
done('play', `${file}: ${r.changes.length} change(s) written${r.added.length ? `, new languages ${r.added.join(', ')}` : ''}`);
|
||||
}
|
||||
|
||||
export async function run(ctx: Ctx): Promise<void> {
|
||||
const { config, root } = ctx.loaded;
|
||||
if (ctx.args._[0] === 'pull') return pull(ctx);
|
||||
const pkg = need(config.play?.packageName, 'play.packageName');
|
||||
const copy = readPlayCopy(ctx);
|
||||
const details = { defaultLanguage: config.play?.defaultLanguage ?? 'en-US', contactEmail: config.app.contactEmail, contactWebsite: config.app.website };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue