diff options
| author | rxliuli <rxliuli@gmail.com> | 2025-11-04 05:03:50 +0800 |
|---|---|---|
| committer | rxliuli <rxliuli@gmail.com> | 2025-11-04 05:03:50 +0800 |
| commit | bce557cc2dc767628bed6aac87301a1be7c5431b (patch) | |
| tree | b51a051228d01fe3306cd7626d4a96768aadb944 /node_modules/@jet-app/app-store/tmp/src/controllers/top-charts | |
init commit
Diffstat (limited to 'node_modules/@jet-app/app-store/tmp/src/controllers/top-charts')
2 files changed, 64 insertions, 0 deletions
diff --git a/node_modules/@jet-app/app-store/tmp/src/controllers/top-charts/charts-hub-page-intent-controller.js b/node_modules/@jet-app/app-store/tmp/src/controllers/top-charts/charts-hub-page-intent-controller.js new file mode 100644 index 0000000..0f1a16e --- /dev/null +++ b/node_modules/@jet-app/app-store/tmp/src/controllers/top-charts/charts-hub-page-intent-controller.js @@ -0,0 +1,39 @@ +import { makeChartsPageIntent } from "../../api/intents/charts-page-intent"; +import { withActiveIntent } from "../../foundation/dependencies/active-intent"; +import { renderChartsHub } from "../../common/charts/charts-hub"; +import { chartsHubPageRoutes, makeChartsHubPageURL } from "../../common/charts/charts-page-url"; +import { injectWebNavigation } from "../../common/web-navigation/inject-web-navigation"; +import { injectSEOData } from "../../api/models/web-renderable-page"; +const APPS_GENRE_ID_STATIC = "36"; +const GAMES_GENRE_ID_STATIC = "6014"; +export const ChartsHubPageIntentController = { + $intentKind: "ChartsHubPageIntent", + routes: chartsHubPageRoutes, + async perform(intent, objectGraphWithoutActiveIntent) { + return await withActiveIntent(objectGraphWithoutActiveIntent, intent, async (objectGraph) => { + var _a; + const [appsPage, gamesPage] = await Promise.all([ + objectGraph.dispatcher.dispatch(makeChartsPageIntent({ + storefront: intent.storefront, + language: intent.language, + platform: intent.platform, + genreId: APPS_GENRE_ID_STATIC, + }), objectGraph), + objectGraph.dispatcher.dispatch(makeChartsPageIntent({ + storefront: intent.storefront, + language: intent.language, + platform: intent.platform, + genreId: GAMES_GENRE_ID_STATIC, + }), objectGraph), + ]); + const hubPage = renderChartsHub(objectGraph, appsPage, gamesPage); + hubPage.canonicalURL = makeChartsHubPageURL(objectGraph, intent); + if (objectGraph.client.isWeb) { + injectWebNavigation(objectGraph, hubPage, intent.platform); + injectSEOData(hubPage, (_a = objectGraph.seo) === null || _a === void 0 ? void 0 : _a.getSEODataForChartsHubPage(objectGraph, hubPage, null)); + } + return hubPage; + }); + }, +}; +//# sourceMappingURL=charts-hub-page-intent-controller.js.map
\ No newline at end of file diff --git a/node_modules/@jet-app/app-store/tmp/src/controllers/top-charts/charts-page-intent-controller.js b/node_modules/@jet-app/app-store/tmp/src/controllers/top-charts/charts-page-intent-controller.js new file mode 100644 index 0000000..79a0667 --- /dev/null +++ b/node_modules/@jet-app/app-store/tmp/src/controllers/top-charts/charts-page-intent-controller.js @@ -0,0 +1,25 @@ +import { injectSEOData } from "../../api/models/web-renderable-page"; +import { withActiveIntent } from "../../foundation/dependencies/active-intent"; +import { chartsPageRoutes, makeChartsPageURL } from "../../common/charts/charts-page-url"; +import { injectWebNavigation } from "../../common/web-navigation/inject-web-navigation"; +import { fetchAndRenderTopChartPage } from "../../common/top-charts/top-charts-page"; +import { validateGenreId } from "../../foundation/media/util"; +export const ChartsPageIntentController = { + $intentKind: "ChartsPageIntent", + routes: chartsPageRoutes, + async perform(intent, objectGraphWithoutActiveIntent) { + return await withActiveIntent(objectGraphWithoutActiveIntent, intent, async (objectGraph) => { + var _a; + // See: https://github.pie.apple.com/its/Jingle/blob/aaccec936f1feed227fd171ae66bb160cf38e497/MZStorePlatform/src/main/clojure/jingle/store/platform/api/controller/categories.clj#L135 + validateGenreId(objectGraph, intent.genreId); + const page = await fetchAndRenderTopChartPage(objectGraph, intent.genreId, null, intent.chart, intent.ageBandId); + if (objectGraph.client.isWeb) { + injectWebNavigation(objectGraph, page, intent.platform); + injectSEOData(page, (_a = objectGraph.seo) === null || _a === void 0 ? void 0 : _a.getSEODataForChartsPage(objectGraph, page, null)); + } + page.canonicalURL = makeChartsPageURL(objectGraph, intent); + return page; + }); + }, +}; +//# sourceMappingURL=charts-page-intent-controller.js.map
\ No newline at end of file |
