play managed publishing: console plan/verify play-publish-changes, ready-to-publish items in play status, desktop hint
This commit is contained in:
parent
29a9683ab7
commit
1bb43fd4a0
20 changed files with 184 additions and 9 deletions
18
cli/play/publish-ready.ts
Normal file
18
cli/play/publish-ready.ts
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
// Read-only: the production releases waiting in Publishing overview (managed publishing), from the tracks and the public store page.
|
||||
import type { ShipConfig } from '../lib/config';
|
||||
import { need } from '../lib/ctx';
|
||||
import { type ReadyChange, readyToPublish } from '../lib/play-publish';
|
||||
import { playPublicPage } from '../lib/play-public';
|
||||
import { playClient } from './client';
|
||||
|
||||
export async function readyFromApi(root: string, config: ShipConfig): Promise<ReadyChange[]> {
|
||||
const pkg = need(config.play?.packageName, 'play.packageName');
|
||||
const play = await playClient(root, pkg);
|
||||
let out: ReadyChange[] = [];
|
||||
await play.read(async id => {
|
||||
const tracks = (await play.call<{ tracks?: unknown[] }>('GET', `${play.API}/edits/${id}/tracks`)).tracks ?? [];
|
||||
const publicPage = await playPublicPage(play.packageName);
|
||||
out = readyToPublish({ tracks, publicPage, managedPublishing: config.play?.managedPublishing ?? null });
|
||||
});
|
||||
return out;
|
||||
}
|
||||
|
|
@ -10,6 +10,7 @@ import { playPublicPage } from '../lib/play-public';
|
|||
import { playReleases, playReleaseLabel } from '../lib/portfolio';
|
||||
import { playClient } from './client';
|
||||
import { listOneTimeProducts } from './products';
|
||||
import { readyLines, readyToPublish } from '../lib/play-publish';
|
||||
import { clearPending, pendingLine, publishingUrl, readPending } from './review-pending';
|
||||
|
||||
interface Track { track: string; releases?: { name?: string; versionCodes?: string[]; status: string; userFraction?: number }[] }
|
||||
|
|
@ -32,7 +33,7 @@ export async function run(ctx: Ctx): Promise<void> {
|
|||
// the App category is not in the API (edits.details has no category field): a console step
|
||||
const cat = playCategoryOf(config);
|
||||
const category = { config: cat?.category ?? null, source: cat?.source ?? null, api: false, plan: 'storebound console plan play-store-settings' };
|
||||
if (ctx.args.has('json')) { printJson({ details, category, tracks, listings, products, publicPage, managedPublishing: config.play?.managedPublishing ?? null, reviewPending }); return; }
|
||||
if (ctx.args.has('json')) { printJson({ details, category, tracks, listings, products, publicPage, managedPublishing: config.play?.managedPublishing ?? null, reviewPending, readyToPublish: readyToPublish({ tracks, publicPage, managedPublishing: config.play?.managedPublishing ?? null }) }); return; }
|
||||
console.log(`${play.packageName}\n details: ${details.defaultLanguage} · ${details.contactEmail ?? '-'} · ${details.contactWebsite ?? '-'}`);
|
||||
console.log(` category: ${cat ? `${cat.category} (${cat.source})` : 'not in the config (play.category)'} · not readable by the API: Store settings is a console step (${category.plan})`);
|
||||
console.log(` listings (${listings.length}): ${listings.map(l => l.language).join(', ') || '-'}`);
|
||||
|
|
@ -42,6 +43,7 @@ export async function run(ctx: Ctx): Promise<void> {
|
|||
}
|
||||
console.log(` public store page: ${publicPage.state === 'public' ? `published (200), live version ${publicPage.versionName ?? (publicPage.varies ? 'varies with device' : 'not shown')}` : publicPage.state === 'notPublic' ? 'not public yet (404)' : `couldn't check it (${publicPage.error ?? 'not read'})`}${publicPage.stale ? ` (last known, ${publicPage.checkedAt.slice(0, 16).replace('T', ' ')} UTC)` : ''}`);
|
||||
for (const r of playReleases({ tracks, publicPage, managedPublishing: config.play?.managedPublishing ?? null }).filter(x => x.track === 'production')) console.log(` production ${r.version ?? '?'} (${r.build ?? '?'}): ${playReleaseLabel(r)}`);
|
||||
for (const l of readyLines(readyToPublish({ tracks, publicPage, managedPublishing: config.play?.managedPublishing ?? null }))) console.log(l);
|
||||
if (pending) console.log(` review: ${pendingLine(pending)}`);
|
||||
console.log(` products (${products.length}):`);
|
||||
for (const p of products) console.log(` ${p.productId.padEnd(40)} ${(p.purchaseOptions ?? []).map(o => `${o.purchaseOptionId}:${o.state ?? '?'}`).join(' ')}`);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue