Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions crawlora/client.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -92586,7 +92586,7 @@ XboxBrowseParams = TypedDict('XboxBrowseParams', {
'sort': NotRequired[Literal['relevance', 'release_date_desc', 'most_popular', 'price_asc', 'price_desc', 'most_wishlisted', 'discount_desc', 'title_asc', 'title_desc']],
'genre': NotRequired[list[Literal['Action & adventure', 'Card & board', 'Casino', 'Classics', 'Companion', 'Educational', 'Family & kids', 'Fighting', 'Multi-Player Online Battle Arena', 'Music', 'Other', 'Platformer', 'Puzzle & trivia', 'Racing & flying', 'Role playing', 'Shooter', 'Simulation', 'Sports', 'Strategy', 'Tools', 'Word']]],
'price': NotRequired[list[Literal['OnSale', '0', '0.01To5', '5To10', '10To20', '20To40', '40To60', '60To']]],
'platform': NotRequired[list[Literal['XboxSeriesX\x7cS', 'XboxOne', 'PC', 'Handheld', 'CloudGaming', 'XboxPlayAnywhere']]],
'platform': NotRequired[list[str]],
'subscription': NotRequired[list[Literal['CFQ7TTC0KHS0', 'CFQ7TTC0P85B', 'CFQ7TTC0K5DJ', 'CFQ7TTC0K6L8', 'CFQ7TTC0KGQ8', 'CFQ7TTC0K5DH', 'CFQ7TTC0QH5H']]],
'age_rating': NotRequired[list[Literal['ESRB:EC', 'ESRB:E', 'ESRB:E10', 'ESRB:T', 'ESRB:M', 'ESRB:AO', 'ESRB:RPEveryone', 'ESRB:RPMature', 'ESRB:RPTeen', 'ESRB:UR']]],
'multiplayer': NotRequired[list[Literal['CrossPlatformMultiplayer', 'CrossPlatformCoop', 'SinglePlayer', 'OnlineMultiplayerWithGold', 'CoopSupportOnline', 'CoopSupportLocal', 'LocalMultiplayer']]],
Expand Down Expand Up @@ -92639,7 +92639,7 @@ XboxSearchParams = TypedDict('XboxSearchParams', {
'sort': NotRequired[Literal['relevance', 'release_date_desc', 'most_popular', 'price_asc', 'price_desc', 'most_wishlisted', 'discount_desc', 'title_asc', 'title_desc']],
'genre': NotRequired[list[Literal['Action & adventure', 'Card & board', 'Casino', 'Classics', 'Companion', 'Educational', 'Family & kids', 'Fighting', 'Multi-Player Online Battle Arena', 'Music', 'Other', 'Platformer', 'Puzzle & trivia', 'Racing & flying', 'Role playing', 'Shooter', 'Simulation', 'Sports', 'Strategy', 'Tools', 'Word']]],
'price': NotRequired[list[Literal['OnSale', '0', '0.01To5', '5To10', '10To20', '20To40', '40To60', '60To']]],
'platform': NotRequired[list[Literal['XboxSeriesX\x7cS', 'XboxOne', 'PC', 'Handheld', 'CloudGaming', 'XboxPlayAnywhere']]],
'platform': NotRequired[list[str]],
'subscription': NotRequired[list[Literal['CFQ7TTC0KHS0', 'CFQ7TTC0P85B', 'CFQ7TTC0K5DJ', 'CFQ7TTC0K6L8', 'CFQ7TTC0KGQ8', 'CFQ7TTC0K5DH', 'CFQ7TTC0QH5H']]],
'age_rating': NotRequired[list[Literal['ESRB:EC', 'ESRB:E', 'ESRB:E10', 'ESRB:T', 'ESRB:M', 'ESRB:AO', 'ESRB:RPEveryone', 'ESRB:RPMature', 'ESRB:RPTeen', 'ESRB:UR']]],
'multiplayer': NotRequired[list[Literal['CrossPlatformMultiplayer', 'CrossPlatformCoop', 'SinglePlayer', 'OnlineMultiplayerWithGold', 'CoopSupportOnline', 'CoopSupportLocal', 'LocalMultiplayer']]],
Expand Down
4 changes: 2 additions & 2 deletions docs/operations.md
Original file line number Diff line number Diff line change
Expand Up @@ -3121,11 +3121,11 @@ Total operations: `3275`
| x | `x.post` | `x-post` | `GET /x/post/{id}` | `id` (path str required)<br>`username` (query str) | `ApiKeyAuth` | `XPostResponse` | |
| x | `x.profile` | `x-profile` | `GET /x/profile/{username}` | `username` (path str required) | `ApiKeyAuth` | `XProfileResponse` | |
| x | `x.profile_posts` | `x-profile-posts` | `GET /x/profile/{username}/posts` | `username` (path str required)<br>`limit` (query int) | `ApiKeyAuth` | `XProfilePostsResponse` | |
| xbox | `xbox.browse` | `xbox-browse` | `GET /xbox/browse` | `cursor` (query str)<br>`sort` (query Literal['relevance', 'release_date_desc', 'most_popular', 'price_asc', 'price_desc', 'most_wishlisted', 'discount_desc', 'title_asc', 'title_desc'])<br>`genre` (query list[Literal['Action & adventure', 'Card & board', 'Casino', 'Classics', 'Companion', 'Educational', 'Family & kids', 'Fighting', 'Multi-Player Online Battle Arena', 'Music', 'Other', 'Platformer', 'Puzzle & trivia', 'Racing & flying', 'Role playing', 'Shooter', 'Simulation', 'Sports', 'Strategy', 'Tools', 'Word']])<br>`price` (query list[Literal['OnSale', '0', '0.01To5', '5To10', '10To20', '20To40', '40To60', '60To']])<br>`platform` (query list[Literal['XboxSeriesX\x7cS', 'XboxOne', 'PC', 'Handheld', 'CloudGaming', 'XboxPlayAnywhere']])<br>`subscription` (query list[Literal['CFQ7TTC0KHS0', 'CFQ7TTC0P85B', 'CFQ7TTC0K5DJ', 'CFQ7TTC0K6L8', 'CFQ7TTC0KGQ8', 'CFQ7TTC0K5DH', 'CFQ7TTC0QH5H']])<br>`age_rating` (query list[Literal['ESRB:EC', 'ESRB:E', 'ESRB:E10', 'ESRB:T', 'ESRB:M', 'ESRB:AO', 'ESRB:RPEveryone', 'ESRB:RPMature', 'ESRB:RPTeen', 'ESRB:UR']])<br>`multiplayer` (query list[Literal['CrossPlatformMultiplayer', 'CrossPlatformCoop', 'SinglePlayer', 'OnlineMultiplayerWithGold', 'CoopSupportOnline', 'CoopSupportLocal', 'LocalMultiplayer']])<br>`technical_features` (query list[Literal['CapabilityXboxEnhanced', 'ConsoleGen9Optimized', 'ConsoleCrossGen', 'Capability4k', 'CapabilityHDR', '60fps', '120fps', 'RayTracing']])<br>`handheld_compatibility` (query list[Literal['VERIFIED', 'PLAYABLE', 'UNSUPPORTED', 'UNKNOWN']])<br>`supported_language` (query list[Literal['ar-SA', 'zh-CN', 'zh-TW', 'cs-CZ', 'da-DK', 'nl-NL', 'en-GB', 'en-US', 'fi-FI', 'fr-FR', 'de-DE', 'el-GR', 'he-IL', 'hu-HU', 'it-IT', 'ja-JP', 'ko-KR', 'nb-NO', 'pl-PL', 'pt-BR', 'pt-PT', 'ru-RU', 'sk-SK', 'es-MX', 'es-ES', 'sv-SE', 'tr-TR']])<br>`accessibility` (query list[Literal['AccessibilityOnLaunch', 'AdjustableDifficulty', 'OnDemandTutorials', 'Pausable', 'ProgressSavingOptions', 'MonoSound', 'CustomVolumeControls', 'NarratedGameMenus', 'StereoSound', 'SpatialAudio', 'SteadyCamera', 'ContrastOptions', 'ColorOptions', 'SubtitleOptions', 'AdjustableTextSize', 'AdjustableInputSensitivity', 'BasicInputRemapping', 'TtsSttCommunications', 'InputRemapping', 'PlayableWithButtonsOnly', 'FullKeyboardSupport', 'PlayableWithMouseOnly', 'PlayableWithTouchOnly', 'NoButtonHolds', 'PlayableWithoutMotionControls', 'NoQuickTimeEvents', 'PlayableWithoutTouchControls', 'SingleStickGameplay', 'StickInversion']])<br>`locale` (query str) | `ApiKeyAuth` | `XboxBrowseResponse` | |
| xbox | `xbox.browse` | `xbox-browse` | `GET /xbox/browse` | `cursor` (query str)<br>`sort` (query Literal['relevance', 'release_date_desc', 'most_popular', 'price_asc', 'price_desc', 'most_wishlisted', 'discount_desc', 'title_asc', 'title_desc'])<br>`genre` (query list[Literal['Action & adventure', 'Card & board', 'Casino', 'Classics', 'Companion', 'Educational', 'Family & kids', 'Fighting', 'Multi-Player Online Battle Arena', 'Music', 'Other', 'Platformer', 'Puzzle & trivia', 'Racing & flying', 'Role playing', 'Shooter', 'Simulation', 'Sports', 'Strategy', 'Tools', 'Word']])<br>`price` (query list[Literal['OnSale', '0', '0.01To5', '5To10', '10To20', '20To40', '40To60', '60To']])<br>`platform` (query list[str])<br>`subscription` (query list[Literal['CFQ7TTC0KHS0', 'CFQ7TTC0P85B', 'CFQ7TTC0K5DJ', 'CFQ7TTC0K6L8', 'CFQ7TTC0KGQ8', 'CFQ7TTC0K5DH', 'CFQ7TTC0QH5H']])<br>`age_rating` (query list[Literal['ESRB:EC', 'ESRB:E', 'ESRB:E10', 'ESRB:T', 'ESRB:M', 'ESRB:AO', 'ESRB:RPEveryone', 'ESRB:RPMature', 'ESRB:RPTeen', 'ESRB:UR']])<br>`multiplayer` (query list[Literal['CrossPlatformMultiplayer', 'CrossPlatformCoop', 'SinglePlayer', 'OnlineMultiplayerWithGold', 'CoopSupportOnline', 'CoopSupportLocal', 'LocalMultiplayer']])<br>`technical_features` (query list[Literal['CapabilityXboxEnhanced', 'ConsoleGen9Optimized', 'ConsoleCrossGen', 'Capability4k', 'CapabilityHDR', '60fps', '120fps', 'RayTracing']])<br>`handheld_compatibility` (query list[Literal['VERIFIED', 'PLAYABLE', 'UNSUPPORTED', 'UNKNOWN']])<br>`supported_language` (query list[Literal['ar-SA', 'zh-CN', 'zh-TW', 'cs-CZ', 'da-DK', 'nl-NL', 'en-GB', 'en-US', 'fi-FI', 'fr-FR', 'de-DE', 'el-GR', 'he-IL', 'hu-HU', 'it-IT', 'ja-JP', 'ko-KR', 'nb-NO', 'pl-PL', 'pt-BR', 'pt-PT', 'ru-RU', 'sk-SK', 'es-MX', 'es-ES', 'sv-SE', 'tr-TR']])<br>`accessibility` (query list[Literal['AccessibilityOnLaunch', 'AdjustableDifficulty', 'OnDemandTutorials', 'Pausable', 'ProgressSavingOptions', 'MonoSound', 'CustomVolumeControls', 'NarratedGameMenus', 'StereoSound', 'SpatialAudio', 'SteadyCamera', 'ContrastOptions', 'ColorOptions', 'SubtitleOptions', 'AdjustableTextSize', 'AdjustableInputSensitivity', 'BasicInputRemapping', 'TtsSttCommunications', 'InputRemapping', 'PlayableWithButtonsOnly', 'FullKeyboardSupport', 'PlayableWithMouseOnly', 'PlayableWithTouchOnly', 'NoButtonHolds', 'PlayableWithoutMotionControls', 'NoQuickTimeEvents', 'PlayableWithoutTouchControls', 'SingleStickGameplay', 'StickInversion']])<br>`locale` (query str) | `ApiKeyAuth` | `XboxBrowseResponse` | |
| xbox | `xbox.collection` | `xbox-collection` | `GET /xbox/collection` | `id` (query Literal['TopFreeGames', 'TopPaidGames', 'OptimizedSeriesXS', 'XboxPlayAnywhere'] required)<br>`cursor` (query str)<br>`locale` (query str) | `ApiKeyAuth` | `XboxCollectionResponse` | |
| xbox | `xbox.game` | `xbox-game` | `GET /xbox/game` | `product_id` (query str required)<br>`locale` (query str) | `ApiKeyAuth` | `XboxGameResponse` | |
| xbox | `xbox.reviews` | `xbox-reviews` | `GET /xbox/reviews` | `product_id` (query str required)<br>`item_count` (query int)<br>`order_by` (query Literal['MostHelpful', 'MostRecent'])<br>`star_filter` (query int)<br>`locale` (query str) | `ApiKeyAuth` | `XboxReviewsResponse` | |
| xbox | `xbox.search` | `xbox-search` | `GET /xbox/search` | `query` (query str required)<br>`category` (query Literal['games', 'addons', 'hardware'])<br>`cursor` (query str)<br>`sort` (query Literal['relevance', 'release_date_desc', 'most_popular', 'price_asc', 'price_desc', 'most_wishlisted', 'discount_desc', 'title_asc', 'title_desc'])<br>`genre` (query list[Literal['Action & adventure', 'Card & board', 'Casino', 'Classics', 'Companion', 'Educational', 'Family & kids', 'Fighting', 'Multi-Player Online Battle Arena', 'Music', 'Other', 'Platformer', 'Puzzle & trivia', 'Racing & flying', 'Role playing', 'Shooter', 'Simulation', 'Sports', 'Strategy', 'Tools', 'Word']])<br>`price` (query list[Literal['OnSale', '0', '0.01To5', '5To10', '10To20', '20To40', '40To60', '60To']])<br>`platform` (query list[Literal['XboxSeriesX\x7cS', 'XboxOne', 'PC', 'Handheld', 'CloudGaming', 'XboxPlayAnywhere']])<br>`subscription` (query list[Literal['CFQ7TTC0KHS0', 'CFQ7TTC0P85B', 'CFQ7TTC0K5DJ', 'CFQ7TTC0K6L8', 'CFQ7TTC0KGQ8', 'CFQ7TTC0K5DH', 'CFQ7TTC0QH5H']])<br>`age_rating` (query list[Literal['ESRB:EC', 'ESRB:E', 'ESRB:E10', 'ESRB:T', 'ESRB:M', 'ESRB:AO', 'ESRB:RPEveryone', 'ESRB:RPMature', 'ESRB:RPTeen', 'ESRB:UR']])<br>`multiplayer` (query list[Literal['CrossPlatformMultiplayer', 'CrossPlatformCoop', 'SinglePlayer', 'OnlineMultiplayerWithGold', 'CoopSupportOnline', 'CoopSupportLocal', 'LocalMultiplayer']])<br>`technical_features` (query list[Literal['CapabilityXboxEnhanced', 'ConsoleGen9Optimized', 'ConsoleCrossGen', 'Capability4k', 'CapabilityHDR', '60fps', '120fps', 'RayTracing']])<br>`handheld_compatibility` (query list[Literal['VERIFIED', 'PLAYABLE', 'UNSUPPORTED', 'UNKNOWN']])<br>`supported_language` (query list[Literal['ar-SA', 'zh-CN', 'zh-TW', 'cs-CZ', 'da-DK', 'nl-NL', 'en-GB', 'en-US', 'fi-FI', 'fr-FR', 'de-DE', 'el-GR', 'he-IL', 'hu-HU', 'it-IT', 'ja-JP', 'ko-KR', 'nb-NO', 'pl-PL', 'pt-BR', 'pt-PT', 'ru-RU', 'sk-SK', 'es-MX', 'es-ES', 'sv-SE', 'tr-TR']])<br>`accessibility` (query list[Literal['AccessibilityOnLaunch', 'AdjustableDifficulty', 'OnDemandTutorials', 'Pausable', 'ProgressSavingOptions', 'MonoSound', 'CustomVolumeControls', 'NarratedGameMenus', 'StereoSound', 'SpatialAudio', 'SteadyCamera', 'ContrastOptions', 'ColorOptions', 'SubtitleOptions', 'AdjustableTextSize', 'AdjustableInputSensitivity', 'BasicInputRemapping', 'TtsSttCommunications', 'InputRemapping', 'PlayableWithButtonsOnly', 'FullKeyboardSupport', 'PlayableWithMouseOnly', 'PlayableWithTouchOnly', 'NoButtonHolds', 'PlayableWithoutMotionControls', 'NoQuickTimeEvents', 'PlayableWithoutTouchControls', 'SingleStickGameplay', 'StickInversion']])<br>`locale` (query str) | `ApiKeyAuth` | `XboxSearchResponse` | |
| xbox | `xbox.search` | `xbox-search` | `GET /xbox/search` | `query` (query str required)<br>`category` (query Literal['games', 'addons', 'hardware'])<br>`cursor` (query str)<br>`sort` (query Literal['relevance', 'release_date_desc', 'most_popular', 'price_asc', 'price_desc', 'most_wishlisted', 'discount_desc', 'title_asc', 'title_desc'])<br>`genre` (query list[Literal['Action & adventure', 'Card & board', 'Casino', 'Classics', 'Companion', 'Educational', 'Family & kids', 'Fighting', 'Multi-Player Online Battle Arena', 'Music', 'Other', 'Platformer', 'Puzzle & trivia', 'Racing & flying', 'Role playing', 'Shooter', 'Simulation', 'Sports', 'Strategy', 'Tools', 'Word']])<br>`price` (query list[Literal['OnSale', '0', '0.01To5', '5To10', '10To20', '20To40', '40To60', '60To']])<br>`platform` (query list[str])<br>`subscription` (query list[Literal['CFQ7TTC0KHS0', 'CFQ7TTC0P85B', 'CFQ7TTC0K5DJ', 'CFQ7TTC0K6L8', 'CFQ7TTC0KGQ8', 'CFQ7TTC0K5DH', 'CFQ7TTC0QH5H']])<br>`age_rating` (query list[Literal['ESRB:EC', 'ESRB:E', 'ESRB:E10', 'ESRB:T', 'ESRB:M', 'ESRB:AO', 'ESRB:RPEveryone', 'ESRB:RPMature', 'ESRB:RPTeen', 'ESRB:UR']])<br>`multiplayer` (query list[Literal['CrossPlatformMultiplayer', 'CrossPlatformCoop', 'SinglePlayer', 'OnlineMultiplayerWithGold', 'CoopSupportOnline', 'CoopSupportLocal', 'LocalMultiplayer']])<br>`technical_features` (query list[Literal['CapabilityXboxEnhanced', 'ConsoleGen9Optimized', 'ConsoleCrossGen', 'Capability4k', 'CapabilityHDR', '60fps', '120fps', 'RayTracing']])<br>`handheld_compatibility` (query list[Literal['VERIFIED', 'PLAYABLE', 'UNSUPPORTED', 'UNKNOWN']])<br>`supported_language` (query list[Literal['ar-SA', 'zh-CN', 'zh-TW', 'cs-CZ', 'da-DK', 'nl-NL', 'en-GB', 'en-US', 'fi-FI', 'fr-FR', 'de-DE', 'el-GR', 'he-IL', 'hu-HU', 'it-IT', 'ja-JP', 'ko-KR', 'nb-NO', 'pl-PL', 'pt-BR', 'pt-PT', 'ru-RU', 'sk-SK', 'es-MX', 'es-ES', 'sv-SE', 'tr-TR']])<br>`accessibility` (query list[Literal['AccessibilityOnLaunch', 'AdjustableDifficulty', 'OnDemandTutorials', 'Pausable', 'ProgressSavingOptions', 'MonoSound', 'CustomVolumeControls', 'NarratedGameMenus', 'StereoSound', 'SpatialAudio', 'SteadyCamera', 'ContrastOptions', 'ColorOptions', 'SubtitleOptions', 'AdjustableTextSize', 'AdjustableInputSensitivity', 'BasicInputRemapping', 'TtsSttCommunications', 'InputRemapping', 'PlayableWithButtonsOnly', 'FullKeyboardSupport', 'PlayableWithMouseOnly', 'PlayableWithTouchOnly', 'NoButtonHolds', 'PlayableWithoutMotionControls', 'NoQuickTimeEvents', 'PlayableWithoutTouchControls', 'SingleStickGameplay', 'StickInversion']])<br>`locale` (query str) | `ApiKeyAuth` | `XboxSearchResponse` | |
| xda | `xda.article` | `xda-article` | `GET /xda/article` | `url` (query str required) | `ApiKeyAuth` | `XdaArticleResponse` | |
| xda | `xda.author` | `xda-author` | `GET /xda/author` | `url` (query str required) | `ApiKeyAuth` | `XdaAuthorResponse` | |
| xda | `xda.headlines` | `xda-headlines` | `GET /xda/headlines` | `section` (query Literal['news', 'features', 'reviews', 'buying-guides', 'tutorials', 'editorials', 'editor-columns', 'deals', 'commerce', 'evergreen', 'performance', 'beats', 'awards', 'hardware', 'processor', 'gpu', 'storage', 'monitors', 'input-devices', 'laptops', 'devices', 'single-board-computers', 'gaming-handhelds', 'prebuilt-pc', 'networking', 'smart-home', 'home', 'other-hardware', 'headset', 'cpu-cooler', 'printer', 'home-internet', 'other-computing-devices', 'phone-reviews', '3d-printing', 'esp32', 'home-lab', 'self-hosting', 'software', 'software-and-services', 'apps', 'ai-tools', 'claude', 'notebooklm', 'productivity', 'os', 'windows', 'windows-tutorials', 'linux-hub', 'linux-tutorials', 'macos', 'macos-tutorials', 'chromeos-tutorials', 'microsoft-edge', 'opera', 'spotify', 'bing', 'gaming', 'gaming-news', 'gaming-reviews', 'entertainment', 'entertainment-segment'] required) | `ApiKeyAuth` | `XdaHeadlinesResponse` | |
Expand Down
15 changes: 11 additions & 4 deletions scripts/generate.py
Original file line number Diff line number Diff line change
Expand Up @@ -52,8 +52,15 @@ def schema_ref_name(schema):


def py_literal(value):
"""Render a Literal string while escaping type-syntax punctuation."""
return repr(str(value)).replace("|", "\\x7c")
"""Render a Literal string with Python's standard escaping."""
return repr(str(value))


def py_enum_type(values):
"""Render enum values, falling back to str for mypy's pipe parsing bug."""
if any("|" in str(value) for value in values):
return "str"
return "Literal[" + ", ".join(py_literal(value) for value in values) + "]"


def _py_schema_type(schema):
Expand All @@ -67,7 +74,7 @@ def _py_schema_type(schema):
return concrete[0] if len(concrete) == 1 else "Any"
enum_schema_values = schema.get("enum") or []
if enum_schema_values:
return "Literal[" + ", ".join(py_literal(value) for value in enum_schema_values) + "]"
return py_enum_type(enum_schema_values)
typ = schema.get("type")
if typ == "integer":
return "int"
Expand Down Expand Up @@ -98,7 +105,7 @@ def py_schema_type(schema):
def py_type(param):
enum_values = param.get("enum") or []
if enum_values:
return "Literal[" + ", ".join(py_literal(value) for value in enum_values) + "]"
return py_enum_type(enum_values)
typ = param.get("type")
if typ == "integer":
return "int"
Expand Down
3 changes: 2 additions & 1 deletion tests/test_client.py
Original file line number Diff line number Diff line change
Expand Up @@ -285,7 +285,8 @@ def test_generated_stub_includes_typed_endpoint_groups(self):
self.assertIn("'q': Required[str]", stub)
self.assertIn("'count': NotRequired[int]", stub)
self.assertIn("WebEmailVerifyBody = ModelContactVerifyRequest", stub)
self.assertIn("'XboxSeriesX\\x7cS'", stub)
browse_stub = stub.split("XboxBrowseParams = TypedDict", 1)[1].split("\n\n", 1)[0]
self.assertIn("'platform': NotRequired[list[str]]", browse_stub)
self.assertIn("'review_count': NotRequired[int | None]", stub)
self.assertIn("def search(self, **params: Unpack[BingSearchParams]) -> BingSearchResponse: ...", stub)
self.assertIn("OperationId = Literal[", stub)
Expand Down
Loading