this repo has no description
at main 1.7 kB view raw
1import { Path } from "../../foundation/network/url-constants"; 2import { makeDeveloperPageIntent } from "../../api/intents/developer-page-intent"; 3import { generateRoutes } from "../../common/util/generate-routes"; 4import { makeDeveloperRequest } from "../../common/developer/developer-request"; 5import { fetchData } from "../../foundation/media/network"; 6import { developerPageFromResponse } from "../../common/developer/developer-common"; 7import { injectWebNavigation } from "../../common/web-navigation/inject-web-navigation"; 8import { injectSEOData } from "../../api/models/web-renderable-page"; 9import { validateAdamId } from "../../foundation/media/util"; 10const { routes } = generateRoutes(makeDeveloperPageIntent, `/${Path.developer}/{name}/{id}`); 11export const DeveloperPageIntentController = { 12 $intentKind: "DeveloperPageIntent", 13 routes, 14 async perform(intent, objectGraph) { 15 var _a; 16 // See: https://github.pie.apple.com/its/Jingle/blob/ce14e21b6ac3dd4be884aa12b26d4e79c6d8aa7a/MZStorePlatform/src/main/java/com/apple/jingle/store/mediaapi/resource/SFMediaAPICommonResourceType.java#L52 17 validateAdamId(objectGraph, intent.id); 18 const mediaApiRequest = makeDeveloperRequest(objectGraph, intent.id); 19 const response = await fetchData(objectGraph, mediaApiRequest); 20 const page = developerPageFromResponse(objectGraph, response); 21 if (objectGraph.client.isWeb) { 22 injectWebNavigation(objectGraph, page); 23 injectSEOData(page, (_a = objectGraph.seo) === null || _a === void 0 ? void 0 : _a.getSEODataForDeveloperPage(objectGraph, page, response)); 24 } 25 return page; 26 }, 27}; 28//# sourceMappingURL=developer-page-intent-controller.js.map