apple creative-assets: App Store Header and Search Results (PRODUCT_PAGE_HEADER_ASSET, APP_STORE_SEARCH_RESULTS_ASSET) through the App Asset Library: local size / alpha / video checks, upload once by MD5, select only approved assets, replace on a changed file; check / validate note, MCP tool, gallery and desktop Art row, docs, pitfall 75
This commit is contained in:
parent
14ffe3545a
commit
e5369090fa
17 changed files with 486 additions and 16 deletions
|
|
@ -71,6 +71,10 @@ const LISTS: Record<string, { type: string; one?: boolean }> = {
|
|||
'subscriptions/winBackOffers': { type: 'winBackOffers' },
|
||||
'betaGroups/betaTesters': { type: 'betaTesters' },
|
||||
'apps/analyticsReportRequests': { type: 'analyticsReportRequests' },
|
||||
'apps/assetLibrary': { type: 'appAssetLibraries', one: true },
|
||||
'appAssetLibraries/images': { type: 'appAssetLibraryImages' },
|
||||
'appAssetLibraries/videos': { type: 'appAssetLibraryVideos' },
|
||||
'appStoreVersionLocalizations/placements': { type: 'appAssetLibraryPlacements' },
|
||||
};
|
||||
/** Stores refuse a second resource with the same key (409 ENTITY_ERROR ... already exists). */
|
||||
const UNIQUE: Record<string, (r: R) => string> = {
|
||||
|
|
@ -97,7 +101,9 @@ const UNIQUE: Record<string, (r: R) => string> = {
|
|||
winBackOffers: r => `${r.rels.subscription}|${r.attributes.offerId}`,
|
||||
betaTesters: r => String(r.attributes.email).toLowerCase(),
|
||||
};
|
||||
const ASSETS = /Screenshots$|^appPreviews$|^appScreenshots$/;
|
||||
const ASSETS = /Screenshots$|^appPreviews$|^appScreenshots$|^appAssetLibrary(Images|Videos)$/;
|
||||
/** App Asset Library assets: a state of their own (AWAITING_UPLOAD -> WAITING_FOR_REVIEW after the commit; a test sets APPROVED). */
|
||||
const LIBRARY = /^appAssetLibrary(Images|Videos)$/;
|
||||
/** Attributes a new resource of a type starts with. */
|
||||
const DEFAULTS: Record<string, Record<string, unknown>> = {
|
||||
inAppPurchases: { state: 'MISSING_METADATA' }, subscriptions: { state: 'MISSING_METADATA' }, reviewSubmissions: { state: 'READY_FOR_REVIEW' },
|
||||
|
|
@ -178,7 +184,7 @@ export class FakeAsc {
|
|||
return json({ errors: [{ status: '409', code: 'ENTITY_ERROR.ATTRIBUTE.INVALID.DUPLICATE', title: 'The provided entity includes an attribute with a value that has already been used', detail: 'already exists' }] }, 409);
|
||||
if (ASSETS.test(d.type) && d.attributes?.fileName) {
|
||||
main.attributes.uploadOperations = [{ method: 'PUT', url: `${UPLOAD_HOST}${main.id}`, offset: 0, length: Number(d.attributes.fileSize ?? 0), requestHeaders: [{ name: 'Content-Type', value: 'image/png' }] }];
|
||||
main.attributes.assetDeliveryState = { state: 'AWAITING_UPLOAD' };
|
||||
if (LIBRARY.test(d.type)) main.attributes.state = 'AWAITING_UPLOAD'; else main.attributes.assetDeliveryState = { state: 'AWAITING_UPLOAD' };
|
||||
}
|
||||
// a tester belongs to the app of its groups (GET /v1/betaTesters?filter[apps]=)
|
||||
if (d.type === 'betaTesters') { const g = [main.rels.betaGroups].flat()[0]; const app = g ? this.res.get(String(g))?.rels.app : undefined; if (app) main.rels.app = app; }
|
||||
|
|
@ -304,7 +310,8 @@ export class FakeAsc {
|
|||
rels: { [singular(self.type)]: self.id, ...Object.fromEntries(Object.entries(inc.relationships ?? {}).map(([k, v]) => [k, v.data.id])) } });
|
||||
if (attrs.uploaded === true && ASSETS.test(self.type)) {
|
||||
const { uploaded: _u, ...rest } = attrs;
|
||||
Object.assign(self.attributes, rest, { assetDeliveryState: { state: this.parts.includes(self.id) ? 'COMPLETE' : 'FAILED' } });
|
||||
if (LIBRARY.test(self.type)) Object.assign(self.attributes, rest, { state: this.parts.includes(self.id) ? 'WAITING_FOR_REVIEW' : 'FAILED' });
|
||||
else Object.assign(self.attributes, rest, { assetDeliveryState: { state: this.parts.includes(self.id) ? 'COMPLETE' : 'FAILED' } });
|
||||
delete self.attributes.uploadOperations;
|
||||
} else if (self.type === 'reviewSubmissions' && (attrs.submitted === true || attrs.canceled === true)) {
|
||||
// seen live (2026-10-12): a REJECTED item that is not marked resolved blocks every submit with this 409, and an
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue