gen-flags: Args.required reads are flags too (edit --ops, privacy-manifest --ios, apple listing --version were refused as unknown options); play games client listAll (no false flags)
This commit is contained in:
parent
d427b5c4a4
commit
567d6ca181
3 changed files with 15 additions and 19 deletions
|
|
@ -50,6 +50,7 @@
|
|||
"upload"
|
||||
],
|
||||
"apple adhoc": [
|
||||
"archive",
|
||||
"csv",
|
||||
"method",
|
||||
"name",
|
||||
|
|
@ -178,6 +179,7 @@
|
|||
"version"
|
||||
],
|
||||
"apple resubmit": [
|
||||
"build",
|
||||
"new-version",
|
||||
"no-submit",
|
||||
"platform",
|
||||
|
|
@ -212,6 +214,7 @@
|
|||
"wait-review"
|
||||
],
|
||||
"apple submit": [
|
||||
"build",
|
||||
"new-version",
|
||||
"no-submit",
|
||||
"platform",
|
||||
|
|
@ -359,7 +362,6 @@
|
|||
"write"
|
||||
],
|
||||
"check": [
|
||||
"achievements",
|
||||
"aso",
|
||||
"capacitor",
|
||||
"cordova",
|
||||
|
|
@ -369,7 +371,6 @@
|
|||
"flutter",
|
||||
"godot",
|
||||
"keychain",
|
||||
"leaderboards",
|
||||
"name",
|
||||
"no-install",
|
||||
"react-native",
|
||||
|
|
@ -453,6 +454,7 @@
|
|||
"dir"
|
||||
],
|
||||
"edit": [
|
||||
"ops",
|
||||
"show"
|
||||
],
|
||||
"flow": [
|
||||
|
|
@ -461,9 +463,7 @@
|
|||
"resume"
|
||||
],
|
||||
"games status": [
|
||||
"achievements",
|
||||
"keychain",
|
||||
"leaderboards",
|
||||
"no-install"
|
||||
],
|
||||
"health": [
|
||||
|
|
@ -598,10 +598,7 @@
|
|||
"csv",
|
||||
"force"
|
||||
],
|
||||
"play games": [
|
||||
"achievements",
|
||||
"leaderboards"
|
||||
],
|
||||
"play games": [],
|
||||
"play images": [
|
||||
"include-drafts",
|
||||
"not-sent-for-review",
|
||||
|
|
@ -703,6 +700,7 @@
|
|||
"with-automatic"
|
||||
],
|
||||
"privacy-manifest": [
|
||||
"ios",
|
||||
"propose",
|
||||
"sdk-dirs",
|
||||
"tracking-domains"
|
||||
|
|
@ -867,7 +865,6 @@
|
|||
"play"
|
||||
],
|
||||
"validate": [
|
||||
"achievements",
|
||||
"add-for-review",
|
||||
"allow-price-changes",
|
||||
"apple",
|
||||
|
|
@ -884,7 +881,6 @@
|
|||
"jobs",
|
||||
"keychain",
|
||||
"lang",
|
||||
"leaderboards",
|
||||
"no-health",
|
||||
"no-install",
|
||||
"no-local",
|
||||
|
|
@ -926,7 +922,6 @@
|
|||
"ws": [
|
||||
"aab",
|
||||
"accounts",
|
||||
"achievements",
|
||||
"add-for-review",
|
||||
"adgroup",
|
||||
"against",
|
||||
|
|
@ -943,6 +938,7 @@
|
|||
"apple",
|
||||
"apply",
|
||||
"apps",
|
||||
"archive",
|
||||
"aso",
|
||||
"base",
|
||||
"base-url",
|
||||
|
|
@ -1028,7 +1024,6 @@
|
|||
"landing",
|
||||
"lang",
|
||||
"languages",
|
||||
"leaderboards",
|
||||
"limit",
|
||||
"listing-text",
|
||||
"listings",
|
||||
|
|
@ -1075,6 +1070,7 @@
|
|||
"only-keywords",
|
||||
"only-missing",
|
||||
"only-terms",
|
||||
"ops",
|
||||
"originality",
|
||||
"out",
|
||||
"param",
|
||||
|
|
|
|||
|
|
@ -41,7 +41,7 @@ export function gamesConfigClient(root: string) {
|
|||
return (t ? JSON.parse(t) : {}) as T;
|
||||
}
|
||||
}
|
||||
async function list(kind: 'achievements' | 'leaderboards', appId: string): Promise<PlayExisting[]> {
|
||||
async function listAll(kind: 'achievements' | 'leaderboards', appId: string): Promise<PlayExisting[]> {
|
||||
const out: PlayExisting[] = [];
|
||||
let page: string | undefined;
|
||||
do {
|
||||
|
|
@ -51,13 +51,13 @@ export function gamesConfigClient(root: string) {
|
|||
} while (page);
|
||||
return out;
|
||||
}
|
||||
return { call, list };
|
||||
return { call, listAll };
|
||||
}
|
||||
|
||||
export const playDefaultLocale = (config: Ctx['loaded']['config']): string => config.play?.defaultLanguage ?? 'en-US';
|
||||
|
||||
export async function readPlayGames(c: ReturnType<typeof gamesConfigClient>, appId: string): Promise<{ leaderboards: PlayExisting[]; achievements: PlayExisting[] }> {
|
||||
return { leaderboards: await c.list('leaderboards', appId), achievements: await c.list('achievements', appId) };
|
||||
return { leaderboards: await c.listAll('leaderboards', appId), achievements: await c.listAll('achievements', appId) };
|
||||
}
|
||||
|
||||
const pending = (plan: ItemPlan[]) => plan.filter(p => p.action !== 'keep');
|
||||
|
|
@ -92,7 +92,7 @@ export async function run(ctx: Ctx): Promise<void> {
|
|||
if (p.action === 'create') {
|
||||
const r = await createOnce({ what: `${p.kind} ${p.id}`, tag: TAG,
|
||||
create: async () => (await c.call<PlayExisting>('POST', `/applications/${appId}/${kind}`, p.attributes)).id,
|
||||
find: async () => (await c.list(kind, appId)).find(x => x.draft?.name?.translations.some(t => t.locale === locale && t.value === name))?.id ?? null });
|
||||
find: async () => (await c.listAll(kind, appId)).find(x => x.draft?.name?.translations.some(t => t.locale === locale && t.value === name))?.id ?? null });
|
||||
log(TAG, `${p.kind} ${p.id}: created as ${r.value} (set playId: "${r.value}" in the config to match it by id)`);
|
||||
} else {
|
||||
await c.call('PUT', `/${kind}/${encodeURIComponent(p.storeId!)}`, p.attributes);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue