diff options
Diffstat (limited to 'node_modules/@jet-app/app-store/tmp/src/common/room/room-request.js')
| -rw-r--r-- | node_modules/@jet-app/app-store/tmp/src/common/room/room-request.js | 48 |
1 files changed, 48 insertions, 0 deletions
diff --git a/node_modules/@jet-app/app-store/tmp/src/common/room/room-request.js b/node_modules/@jet-app/app-store/tmp/src/common/room/room-request.js new file mode 100644 index 0000000..ba0337b --- /dev/null +++ b/node_modules/@jet-app/app-store/tmp/src/common/room/room-request.js @@ -0,0 +1,48 @@ +import { Request, defaultAdditionalPlatformsForClient } from "../../foundation/media/data-fetching"; +import { shouldFetchCustomAttributes } from "../product-page/product-page-variants"; +import { shouldUsePrerenderedIconArtwork } from "../content/content"; +import { setPreviewPlatform } from "../preview-platform"; +export function createRoomRequest(objectGraph, roomId) { + const mediaApiRequest = new Request(objectGraph) + .withIdOfType(roomId, "rooms") + .includingAgeRestrictions() + .includingMacOSCompatibleIOSAppsWhenSupported(true); + if (objectGraph.client.isWeb) { + mediaApiRequest.includingAdditionalPlatforms(defaultAdditionalPlatformsForClient(objectGraph)); + setPreviewPlatform(objectGraph, mediaApiRequest); + } + return mediaApiRequest; +} +export function prepareRoomRequest(objectGraph, request) { + return request + .includingAdditionalPlatforms(defaultAdditionalPlatformsForClient(objectGraph)) + .includingAttributes(defaultAttributesForRoomRequest(objectGraph)) + .usingCustomAttributes(shouldFetchCustomAttributes(objectGraph)) + .includingAgeRestrictions() + .includingMacOSCompatibleIOSAppsWhenSupported(true); +} +export function defaultAttributesForRoomRequest(objectGraph) { + const attributes = [ + "editorialArtwork", + "editorialVideo", + "isAppleWatchSupported", + "requiredCapabilities", + ]; + if (objectGraph.appleSilicon.isSupportEnabled) { + attributes.push("macRequiredCapabilities"); + } + if (objectGraph.client.isMac) { + attributes.push("hasMacIPAPackage"); + } + if (objectGraph.client.isVision) { + attributes.push("compatibilityControllerRequirement"); + } + if (objectGraph.bag.enableUpdatedAgeRatings) { + attributes.push("ageRating"); + } + if (shouldUsePrerenderedIconArtwork(objectGraph)) { + attributes.push("iconArtwork"); + } + return attributes; +} +//# sourceMappingURL=room-request.js.map
\ No newline at end of file |
