WIP from the MacBook: apple platform helper for submit, resubmit, release and status
This commit is contained in:
parent
3e4015b686
commit
96c1074701
8 changed files with 169 additions and 57 deletions
|
|
@ -25,6 +25,7 @@
|
|||
// https://developer.apple.com/help/app-store-connect/manage-submissions-to-app-review/submit-an-in-app-purchase
|
||||
import type { Req } from '../apple/jsonapi';
|
||||
import { one } from '../apple/jsonapi';
|
||||
import type { ApplePlatform } from './apple-platform';
|
||||
|
||||
export const MAX_SUBMISSION_ITEMS = 200;
|
||||
|
||||
|
|
@ -66,6 +67,8 @@ export interface SubmitState {
|
|||
/** Every open review submission (chooseSubmission) and what was decided. */
|
||||
open?: OpenSub[];
|
||||
choice?: SubmissionChoice;
|
||||
/** The App Store platform of the app versions and submissions (IOS when left out; apple-platform.ts). */
|
||||
platform?: ApplePlatform;
|
||||
}
|
||||
|
||||
export interface OpenSub { id: string; state: string; items: { id?: string; kind: string; versionId: string; state: string }[] }
|
||||
|
|
@ -212,7 +215,7 @@ export function planIapSubmission(s: SubmitState, want: string[], o: { withVersi
|
|||
}
|
||||
if (plan.items.length + (s.draft?.itemVersionIds.length ?? 0) > MAX_SUBMISSION_ITEMS) plan.blockers.push(`more than ${MAX_SUBMISSION_ITEMS} items in one submission: use --only for a part`);
|
||||
const sid = s.draft?.id ?? '${submission}';
|
||||
if (!s.draft && plan.items.length) plan.prepare.push({ method: 'POST', path: '/v1/reviewSubmissions', note: 'new draft review submission', body: { data: { type: 'reviewSubmissions', attributes: { platform: 'IOS' }, relationships: { app: one('apps', '${app}') } } } });
|
||||
if (!s.draft && plan.items.length) plan.prepare.push({ method: 'POST', path: '/v1/reviewSubmissions', note: 'new draft review submission', body: { data: { type: 'reviewSubmissions', attributes: { platform: s.platform ?? 'IOS' }, relationships: { app: one('apps', '${app}') } } } });
|
||||
for (const it of plan.items) plan.prepare.push({ method: 'POST', path: '/v1/reviewSubmissionItems', note: it.label,
|
||||
body: { data: { type: 'reviewSubmissionItems', relationships: { reviewSubmission: one('reviewSubmissions', sid), [it.kind]: one(ITEM_TYPE[it.kind], it.versionId) } } } });
|
||||
plan.submit = { method: 'PATCH', path: `/v1/reviewSubmissions/${sid}`, note: 'submit for App Review', body: { data: { type: 'reviewSubmissions', id: sid, attributes: { submitted: true } } } };
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue