From 138c983060762a0a81ae0f217e3bfe676bde2437 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Thu, 6 Jun 2024 11:52:24 +0900 Subject: [PATCH 1/6] use latest-user-agent MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ふぁ --- test/python/test_serialize.py | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/test/python/test_serialize.py b/test/python/test_serialize.py index 624e4d3..2130c76 100644 --- a/test/python/test_serialize.py +++ b/test/python/test_serialize.py @@ -11,6 +11,7 @@ from enum import Enum from pathlib import Path import openapi_client as pt +import urllib3 warnings.filterwarnings("ignore") logging.basicConfig(level=logging.DEBUG, format="%(asctime)s %(levelname)s %(message)s") @@ -216,11 +217,17 @@ if __name__ == "__main__": }, ) + latest_user_agent_res = urllib3.PoolManager().request( + "GET", + "https://raw.githubusercontent.com/fa0311/latest-user-agent/main/output.json", + ) + + latest_user_agent = json.loads(latest_user_agent_res.data.decode("utf-8")) + api_conf.access_token = "AAAAAAAAAAAAAAAAAAAAANRILgAAAAAAnNwIzUejRCOuH5E6I8xnZz4puTs%3D1Zv7ttfk8LF81IUq16cHjhLTvJu4FA33AGWWjCpTnA" api_client = pt.ApiClient(configuration=api_conf, cookie=cookies_str) - api_client.user_agent = "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/123.0.0.0 Safari/537.36" - + api_client.user_agent = latest_user_agent["chrome"] error_count = 0 for x in [pt.DefaultApi, pt.TweetApi, pt.UserApi, pt.UsersApi, pt.UserListApi]: From f0e37687a49ada41b48268384980cd31f0c70d0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Thu, 6 Jun 2024 11:52:47 +0900 Subject: [PATCH 2/6] update model MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ふぁ --- dist/compatible/openapi-3.0.yaml | 81 ++++++++++++++--- .../compatible_discriminator/openapi-3.0.yaml | 81 ++++++++++++++--- dist/docs/openapi-3.0.yaml | 90 +++++++++++++++---- src/openapi/schemas/tweet.yaml | 57 +++++++++++- src/openapi/schemas/user.yaml | 20 +++++ 5 files changed, 289 insertions(+), 40 deletions(-) diff --git a/dist/compatible/openapi-3.0.yaml b/dist/compatible/openapi-3.0.yaml index afac807..9714a66 100644 --- a/dist/compatible/openapi-3.0.yaml +++ b/dist/compatible/openapi-3.0.yaml @@ -29,6 +29,12 @@ components: type: string required: - url + AllowDownloadStatus: + properties: + allow_download: + type: boolean + required: + - allow_download Article: properties: article_results: @@ -98,12 +104,28 @@ components: - original_img_width - original_img_url - color_info + ArticleLifecycleState: + properties: + modified_at_secs: + type: integer + required: + - modified_at_secs + ArticleMetadata: + properties: + first_published_at_secs: + type: integer + required: + - first_published_at_secs ArticleResult: properties: cover_media: $ref: '#/components/schemas/ArticleCoverMedia' id: type: string + lifecycle_state: + $ref: '#/components/schemas/ArticleLifecycleState' + metadata: + $ref: '#/components/schemas/ArticleMetadata' preview_text: type: string rest_id: @@ -117,6 +139,8 @@ components: - title - preview_text - cover_media + - metadata + - lifecycle_state ArticleResults: properties: result: @@ -955,8 +979,9 @@ components: Media: properties: additional_media_info: - additionalProperties: true - type: object + $ref: '#/components/schemas/AdditionalMediaInfo' + allow_download_status: + $ref: '#/components/schemas/AllowDownloadStatus' display_url: format: uri type: string @@ -978,6 +1003,8 @@ components: type: array media_key: type: string + media_results: + $ref: '#/components/schemas/MediaResults' media_url_https: format: uri type: string @@ -1003,8 +1030,7 @@ components: format: uri type: string video_info: - additionalProperties: true - type: object + $ref: '#/components/schemas/MediaVideoInfo' required: - display_url - expanded_url @@ -1017,10 +1043,13 @@ components: - original_info - media_key - ext_media_availability + - media_results MediaExtended: properties: additional_media_info: $ref: '#/components/schemas/AdditionalMediaInfo' + allow_download_status: + $ref: '#/components/schemas/AllowDownloadStatus' display_url: format: uri type: string @@ -1044,6 +1073,8 @@ components: $ref: '#/components/schemas/MediaStats' media_key: type: string + media_results: + $ref: '#/components/schemas/MediaResults' media_url_https: format: uri type: string @@ -1081,6 +1112,7 @@ components: - url - sizes - original_info + - media_results MediaOriginalInfo: properties: focus_rects: @@ -1110,6 +1142,18 @@ components: - w - h type: object + MediaResult: + properties: + media_key: + type: string + required: + - media_key + MediaResults: + properties: + result: + $ref: '#/components/schemas/MediaResult' + required: + - result MediaSize: properties: h: @@ -2566,6 +2610,8 @@ components: super_following: default: false type: boolean + tipjar_settings: + $ref: '#/components/schemas/UserTipJarSettings' user_seed_tweet_count: type: integer verification_info: @@ -2581,6 +2627,7 @@ components: - super_followed_by - super_following - profile_image_shape + - tipjar_settings UserFeatures: properties: mediatool_studio_library: @@ -2881,6 +2928,22 @@ components: properties: result: $ref: '#/components/schemas/UserUnion' + UserTipJarSettings: + properties: + bitcoin_handle: + type: string + cash_app_handle: + type: string + ethereum_handle: + type: string + gofundme_handle: + type: string + is_enabled: + type: boolean + patreon_handle: + type: string + venmo_handle: + type: string UserTweetsData: properties: user: @@ -5127,17 +5190,15 @@ paths: name: pathQueryId required: true schema: - default: eL8vHLgEw2ZL9X9dKdakLQ - example: eL8vHLgEw2ZL9X9dKdakLQ + default: GX5ovLTwyoN1Td13GHvhIg + example: GX5ovLTwyoN1Td13GHvhIg type: string - in: query name: variables required: true schema: - default: '{"count": 20, "includePromotedContent": true, "latestControlAvailable": - true}' - example: '{"count": 20, "includePromotedContent": true, "latestControlAvailable": - true}' + default: '{"listId": "1539453138322673664", "count": 20}' + example: '{"listId": "1539453138322673664", "count": 20}' type: string - in: query name: features diff --git a/dist/compatible_discriminator/openapi-3.0.yaml b/dist/compatible_discriminator/openapi-3.0.yaml index 7e4839e..682b8c1 100644 --- a/dist/compatible_discriminator/openapi-3.0.yaml +++ b/dist/compatible_discriminator/openapi-3.0.yaml @@ -29,6 +29,12 @@ components: type: string required: - url + AllowDownloadStatus: + properties: + allow_download: + type: boolean + required: + - allow_download Article: properties: article_results: @@ -98,12 +104,28 @@ components: - original_img_width - original_img_url - color_info + ArticleLifecycleState: + properties: + modified_at_secs: + type: integer + required: + - modified_at_secs + ArticleMetadata: + properties: + first_published_at_secs: + type: integer + required: + - first_published_at_secs ArticleResult: properties: cover_media: $ref: '#/components/schemas/ArticleCoverMedia' id: type: string + lifecycle_state: + $ref: '#/components/schemas/ArticleLifecycleState' + metadata: + $ref: '#/components/schemas/ArticleMetadata' preview_text: type: string rest_id: @@ -117,6 +139,8 @@ components: - title - preview_text - cover_media + - metadata + - lifecycle_state ArticleResults: properties: result: @@ -955,8 +979,9 @@ components: Media: properties: additional_media_info: - additionalProperties: true - type: object + $ref: '#/components/schemas/AdditionalMediaInfo' + allow_download_status: + $ref: '#/components/schemas/AllowDownloadStatus' display_url: format: uri type: string @@ -978,6 +1003,8 @@ components: type: array media_key: type: string + media_results: + $ref: '#/components/schemas/MediaResults' media_url_https: format: uri type: string @@ -1003,8 +1030,7 @@ components: format: uri type: string video_info: - additionalProperties: true - type: object + $ref: '#/components/schemas/MediaVideoInfo' required: - display_url - expanded_url @@ -1017,10 +1043,13 @@ components: - original_info - media_key - ext_media_availability + - media_results MediaExtended: properties: additional_media_info: $ref: '#/components/schemas/AdditionalMediaInfo' + allow_download_status: + $ref: '#/components/schemas/AllowDownloadStatus' display_url: format: uri type: string @@ -1044,6 +1073,8 @@ components: $ref: '#/components/schemas/MediaStats' media_key: type: string + media_results: + $ref: '#/components/schemas/MediaResults' media_url_https: format: uri type: string @@ -1081,6 +1112,7 @@ components: - url - sizes - original_info + - media_results MediaOriginalInfo: properties: focus_rects: @@ -1110,6 +1142,18 @@ components: - w - h type: object + MediaResult: + properties: + media_key: + type: string + required: + - media_key + MediaResults: + properties: + result: + $ref: '#/components/schemas/MediaResult' + required: + - result MediaSize: properties: h: @@ -2566,6 +2610,8 @@ components: super_following: default: false type: boolean + tipjar_settings: + $ref: '#/components/schemas/UserTipJarSettings' user_seed_tweet_count: type: integer verification_info: @@ -2581,6 +2627,7 @@ components: - super_followed_by - super_following - profile_image_shape + - tipjar_settings UserFeatures: properties: mediatool_studio_library: @@ -2881,6 +2928,22 @@ components: properties: result: $ref: '#/components/schemas/UserUnion' + UserTipJarSettings: + properties: + bitcoin_handle: + type: string + cash_app_handle: + type: string + ethereum_handle: + type: string + gofundme_handle: + type: string + is_enabled: + type: boolean + patreon_handle: + type: string + venmo_handle: + type: string UserTweetsData: properties: user: @@ -5101,17 +5164,15 @@ paths: name: pathQueryId required: true schema: - default: eL8vHLgEw2ZL9X9dKdakLQ - example: eL8vHLgEw2ZL9X9dKdakLQ + default: GX5ovLTwyoN1Td13GHvhIg + example: GX5ovLTwyoN1Td13GHvhIg type: string - in: query name: variables required: true schema: - default: '{"count": 20, "includePromotedContent": true, "latestControlAvailable": - true}' - example: '{"count": 20, "includePromotedContent": true, "latestControlAvailable": - true}' + default: '{"listId": "1539453138322673664", "count": 20}' + example: '{"listId": "1539453138322673664", "count": 20}' type: string - in: query name: features diff --git a/dist/docs/openapi-3.0.yaml b/dist/docs/openapi-3.0.yaml index 5b93cae..f7bbf97 100644 --- a/dist/docs/openapi-3.0.yaml +++ b/dist/docs/openapi-3.0.yaml @@ -29,6 +29,12 @@ components: type: string required: - url + AllowDownloadStatus: + properties: + allow_download: + type: boolean + required: + - allow_download Article: properties: article_results: @@ -98,12 +104,28 @@ components: - original_img_width - original_img_url - color_info + ArticleLifecycleState: + properties: + modified_at_secs: + type: integer + required: + - modified_at_secs + ArticleMetadata: + properties: + first_published_at_secs: + type: integer + required: + - first_published_at_secs ArticleResult: properties: cover_media: $ref: '#/components/schemas/ArticleCoverMedia' id: type: string + lifecycle_state: + $ref: '#/components/schemas/ArticleLifecycleState' + metadata: + $ref: '#/components/schemas/ArticleMetadata' preview_text: type: string rest_id: @@ -117,6 +139,8 @@ components: - title - preview_text - cover_media + - metadata + - lifecycle_state ArticleResults: properties: result: @@ -955,8 +979,9 @@ components: Media: properties: additional_media_info: - additionalProperties: true - type: object + $ref: '#/components/schemas/AdditionalMediaInfo' + allow_download_status: + $ref: '#/components/schemas/AllowDownloadStatus' display_url: format: uri type: string @@ -978,6 +1003,8 @@ components: type: array media_key: type: string + media_results: + $ref: '#/components/schemas/MediaResults' media_url_https: format: uri type: string @@ -1003,8 +1030,7 @@ components: format: uri type: string video_info: - additionalProperties: true - type: object + $ref: '#/components/schemas/MediaVideoInfo' required: - display_url - expanded_url @@ -1017,10 +1043,13 @@ components: - original_info - media_key - ext_media_availability + - media_results MediaExtended: properties: additional_media_info: $ref: '#/components/schemas/AdditionalMediaInfo' + allow_download_status: + $ref: '#/components/schemas/AllowDownloadStatus' display_url: format: uri type: string @@ -1044,6 +1073,8 @@ components: $ref: '#/components/schemas/MediaStats' media_key: type: string + media_results: + $ref: '#/components/schemas/MediaResults' media_url_https: format: uri type: string @@ -1081,6 +1112,7 @@ components: - url - sizes - original_info + - media_results MediaOriginalInfo: properties: focus_rects: @@ -1110,6 +1142,18 @@ components: - w - h type: object + MediaResult: + properties: + media_key: + type: string + required: + - media_key + MediaResults: + properties: + result: + $ref: '#/components/schemas/MediaResult' + required: + - result MediaSize: properties: h: @@ -2566,6 +2610,8 @@ components: super_following: default: false type: boolean + tipjar_settings: + $ref: '#/components/schemas/UserTipJarSettings' user_seed_tweet_count: type: integer verification_info: @@ -2581,6 +2627,7 @@ components: - super_followed_by - super_following - profile_image_shape + - tipjar_settings UserFeatures: properties: mediatool_studio_library: @@ -2881,6 +2928,22 @@ components: properties: result: $ref: '#/components/schemas/UserUnion' + UserTipJarSettings: + properties: + bitcoin_handle: + type: string + cash_app_handle: + type: string + ethereum_handle: + type: string + gofundme_handle: + type: string + is_enabled: + type: boolean + patreon_handle: + type: string + venmo_handle: + type: string UserTweetsData: properties: user: @@ -6002,8 +6065,8 @@ paths: name: pathQueryId required: true schema: - default: eL8vHLgEw2ZL9X9dKdakLQ - example: eL8vHLgEw2ZL9X9dKdakLQ + default: GX5ovLTwyoN1Td13GHvhIg + example: GX5ovLTwyoN1Td13GHvhIg type: string - content: application/json: @@ -6013,18 +6076,13 @@ paths: default: 20 example: 20 type: integer - includePromotedContent: - default: true - example: true - type: boolean - latestControlAvailable: - default: true - example: true - type: boolean + listId: + default: '1539453138322673664' + example: '1539453138322673664' + type: string required: + - listId - count - - includePromotedContent - - latestControlAvailable type: object in: query name: variables diff --git a/src/openapi/schemas/tweet.yaml b/src/openapi/schemas/tweet.yaml index 280cc1b..b3c121a 100644 --- a/src/openapi/schemas/tweet.yaml +++ b/src/openapi/schemas/tweet.yaml @@ -999,6 +999,7 @@ components: - "original_info" - "media_key" - "ext_media_availability" + - "media_results" properties: display_url: type: string @@ -1033,11 +1034,9 @@ components: ext_media_availability: $ref: "#/components/schemas/ExtMediaAvailability" video_info: - type: object - additionalProperties: true # todo + $ref: "#/components/schemas/MediaVideoInfo" additional_media_info: - type: object - additionalProperties: true # todo + $ref: "#/components/schemas/AdditionalMediaInfo" source_user_id_str: type: string pattern: "^[0-9]+$" @@ -1048,6 +1047,10 @@ components: type: string sensitive_media_warning: $ref: "#/components/schemas/SensitiveMediaWarning" + allow_download_status: + $ref: "#/components/schemas/AllowDownloadStatus" + media_results: + $ref: "#/components/schemas/MediaResults" TweetLegacyScopes: required: @@ -1095,6 +1098,7 @@ components: # - "features" - "sizes" - "original_info" + - "media_results" properties: display_url: type: string @@ -1144,6 +1148,10 @@ components: type: string sensitive_media_warning: $ref: "#/components/schemas/SensitiveMediaWarning" + allow_download_status: + $ref: "#/components/schemas/AllowDownloadStatus" + media_results: + $ref: "#/components/schemas/MediaResults" MediaOriginalInfo: required: @@ -1336,6 +1344,8 @@ components: - "title" - "preview_text" - "cover_media" + - "metadata" + - "lifecycle_state" properties: rest_id: type: string @@ -1348,6 +1358,10 @@ components: type: string cover_media: $ref: "#/components/schemas/ArticleCoverMedia" + metadata: + $ref: "#/components/schemas/ArticleMetadata" + lifecycle_state: + $ref: "#/components/schemas/ArticleLifecycleState" ArticleCoverMedia: required: @@ -1416,3 +1430,38 @@ components: type: integer red: type: integer + + ArticleMetadata: + required: + - "first_published_at_secs" + properties: + first_published_at_secs: + type: integer + + ArticleLifecycleState: + required: + - "modified_at_secs" + properties: + modified_at_secs: + type: integer + + AllowDownloadStatus: + required: + - "allow_download" + properties: + allow_download: + type: boolean + + MediaResults: + required: + - "result" + properties: + result: + $ref: "#/components/schemas/MediaResult" + + MediaResult: + required: + - "media_key" + properties: + media_key: + type: string diff --git a/src/openapi/schemas/user.yaml b/src/openapi/schemas/user.yaml index 89755af..e626c22 100644 --- a/src/openapi/schemas/user.yaml +++ b/src/openapi/schemas/user.yaml @@ -39,6 +39,7 @@ components: - "super_followed_by" - "super_following" - "profile_image_shape" + - "tipjar_settings" properties: __typename: @@ -92,6 +93,8 @@ components: $ref: "#/components/schemas/UserVerificationInfo" is_profile_translatable: type: boolean + tipjar_settings: + $ref: "#/components/schemas/UserTipJarSettings" UserProfessional: required: @@ -194,6 +197,23 @@ components: type: string enum: ["ExternalUrl"] + UserTipJarSettings: + properties: + is_enabled: + type: boolean + patreon_handle: + type: string + bitcoin_handle: + type: string + ethereum_handle: + type: string + cash_app_handle: + type: string + venmo_handle: + type: string + gofundme_handle: + type: string # uri + UserLegacy: required: - "blocked_by" From d9082fbeeabd23bc24973f348d459b83f835fe21 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Thu, 6 Jun 2024 13:17:12 +0900 Subject: [PATCH 3/6] add Actions for Bookmarking #63 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ふぁ --- src/config/placeholder.json | 12 ++++++++ src/openapi/paths/post.yaml | 60 +++++++++++++++++++++++++++++++++++++ 2 files changed, 72 insertions(+) diff --git a/src/config/placeholder.json b/src/config/placeholder.json index 441d9e5..7816714 100644 --- a/src/config/placeholder.json +++ b/src/config/placeholder.json @@ -756,6 +756,18 @@ "dark_request": false } }, + "CreateBookmark": { + "queryId": "aoDbu3RHznuiSkQ9aNM67Q", + "variables": { + "tweet_id": "1349129669258448897" + } + }, + "DeleteBookmark": { + "queryId": "Wlmlj2-xzyS1GN3a6cj-mQ", + "variables": { + "tweet_id": "1349129669258448897" + } + }, "#=====v1.1====": { "url": "https://twitter.com/i/api/1.1/" }, diff --git a/src/openapi/paths/post.yaml b/src/openapi/paths/post.yaml index 86680fd..cb9f623 100644 --- a/src/openapi/paths/post.yaml +++ b/src/openapi/paths/post.yaml @@ -100,6 +100,38 @@ paths: tags: - "post" + /graphql/{pathQueryId}/CreateBookmark: + post: + operationId: postCreateBookmark + description: create Bookmark + responses: + "200": + description: Successful operation + content: + application/json: + schema: + oneOf: + - $ref: "#/components/schemas/CreateBookmarkResponse" + - $ref: "./../schemas/error.yaml#/components/schemas/Errors" + tags: + - "post" + + /graphql/{pathQueryId}/DeleteBookmark: + post: + operationId: postDeleteBookmark + description: delete Bookmark + responses: + "200": + description: Successful operation + content: + application/json: + schema: + oneOf: + - $ref: "#/components/schemas/DeleteBookmarkResponse" + - $ref: "./../schemas/error.yaml#/components/schemas/Errors" + tags: + - "post" + components: schemas: FavoriteTweetResponseData: @@ -256,3 +288,31 @@ components: properties: tweet_results: type: object + + CreateBookmarkResponse: + required: + - "data" + properties: + data: + $ref: "#/components/schemas/CreateBookmarkResponseData" + + CreateBookmarkResponseData: + required: + - "tweet_bookmark_put" + properties: + tweet_bookmark_put: + type: string + + DeleteBookmarkResponse: + required: + - "data" + properties: + data: + $ref: "#/components/schemas/DeleteBookmarkResponseData" + + DeleteBookmarkResponseData: + required: + - "tweet_bookmark_delete" + properties: + tweet_bookmark_delete: + type: string From 0d0f563c0d459636412d839281920edca7fbb4a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Thu, 6 Jun 2024 13:18:26 +0900 Subject: [PATCH 4/6] fix model MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ふぁ --- src/openapi/schemas/tweet.yaml | 25 ++++++++++++++++++++++--- src/openapi/schemas/user.yaml | 29 ++++++++++++++++++++++++++++- 2 files changed, 50 insertions(+), 4 deletions(-) diff --git a/src/openapi/schemas/tweet.yaml b/src/openapi/schemas/tweet.yaml index b3c121a..36aff59 100644 --- a/src/openapi/schemas/tweet.yaml +++ b/src/openapi/schemas/tweet.yaml @@ -33,6 +33,8 @@ components: additionalProperties: true # todo tweetInterstitial: $ref: "#/components/schemas/TweetInterstitial" + mediaVisibilityResults: + $ref: "#/components/schemas/MediaVisibilityResults" TweetInterstitial: required: @@ -95,6 +97,26 @@ components: type: string enum: [ExternalUrl] + MediaVisibilityResults: + required: + - "blurred_image_interstitial" + properties: + blurred_image_interstitial: + $ref: "#/components/schemas/MediaVisibilityResultsBlurredImageInterstitial" + + MediaVisibilityResultsBlurredImageInterstitial: + required: + - "opacity" + - "text" + - "title" + properties: + opacity: + type: number + text: + $ref: "#/components/schemas/TweetInterstitialText" + title: + $ref: "#/components/schemas/TweetInterstitialText" + TweetInterstitialRevealText: required: - "rtl" @@ -999,7 +1021,6 @@ components: - "original_info" - "media_key" - "ext_media_availability" - - "media_results" properties: display_url: type: string @@ -1098,7 +1119,6 @@ components: # - "features" - "sizes" - "original_info" - - "media_results" properties: display_url: type: string @@ -1345,7 +1365,6 @@ components: - "preview_text" - "cover_media" - "metadata" - - "lifecycle_state" properties: rest_id: type: string diff --git a/src/openapi/schemas/user.yaml b/src/openapi/schemas/user.yaml index e626c22..95d9c29 100644 --- a/src/openapi/schemas/user.yaml +++ b/src/openapi/schemas/user.yaml @@ -39,7 +39,6 @@ components: - "super_followed_by" - "super_following" - "profile_image_shape" - - "tipjar_settings" properties: __typename: @@ -95,6 +94,8 @@ components: type: boolean tipjar_settings: $ref: "#/components/schemas/UserTipJarSettings" + legacy_extended_profile: + $ref: "#/components/schemas/UserLegacyExtendedProfile" UserProfessional: required: @@ -214,6 +215,32 @@ components: gofundme_handle: type: string # uri + UserLegacyExtendedProfile: + properties: + birthdate: + $ref: "#/components/schemas/UserLegacyExtendedProfileBirthdate" + + UserLegacyExtendedProfileBirthdate: + required: + - "day" + - "month" + - "year" + - "visibility" + - "year_visibility" + properties: + day: + type: integer + month: + type: integer + year: + type: integer + visibility: + type: string + enum: ["Self", "Public", "MutualFollow", "Followers", "Following"] + year_visibility: + type: string + enum: ["Self", "Public", "MutualFollow", "Followers", "Following"] + UserLegacy: required: - "blocked_by" From 8653d2a289c681d76b36d37eeea01044f663d5d9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Thu, 6 Jun 2024 13:18:40 +0900 Subject: [PATCH 5/6] fix test MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ふぁ --- test/python/test_serialize.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/test/python/test_serialize.py b/test/python/test_serialize.py index 2130c76..bef87aa 100644 --- a/test/python/test_serialize.py +++ b/test/python/test_serialize.py @@ -284,7 +284,7 @@ if __name__ == "__main__": try: logger.info("Try: Self UserByScreenName Test") - kwargs = get_kwargs("UserByScreenName", {"screen_name": "a810810931931"}) + kwargs = get_kwargs("UserByScreenName", {"screen_name": "NxWDOyLMd483329"}) res = pt.UserApi(api_client).get_user_by_screen_name_with_http_info(**kwargs) data = res.data.to_dict() @@ -295,14 +295,14 @@ if __name__ == "__main__": ) logger.info(f"Match rate: {rate}") screen_name = data["data"]["user"]["result"]["legacy"]["screen_name"] - if not screen_name == "a810810931931": + if not screen_name == "NxWDOyLMd483329": raise Exception("UserByScreenName failed") except Exception as e: error_dump(e) error_count += 1 ids = [ - "1180389371481976833", + # "1180389371481976833", banned "900282258736545792", "1212617657003859968", "2455740283", From 5af7f4827b474ade7b8c585fc10422332df62384 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Thu, 6 Jun 2024 13:18:44 +0900 Subject: [PATCH 6/6] build MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ふぁ --- dist/compatible/openapi-3.0.yaml | 226 +++++++++++++++++- .../compatible_discriminator/openapi-3.0.yaml | 222 ++++++++++++++++- dist/docs/openapi-3.0.yaml | 226 +++++++++++++++++- 3 files changed, 662 insertions(+), 12 deletions(-) diff --git a/dist/compatible/openapi-3.0.yaml b/dist/compatible/openapi-3.0.yaml index 9714a66..1828bf8 100644 --- a/dist/compatible/openapi-3.0.yaml +++ b/dist/compatible/openapi-3.0.yaml @@ -140,7 +140,6 @@ components: - preview_text - cover_media - metadata - - lifecycle_state ArticleResults: properties: result: @@ -546,6 +545,18 @@ components: - ctaBehavior - callbacks - clientEventInfo + CreateBookmarkResponse: + properties: + data: + $ref: '#/components/schemas/CreateBookmarkResponseData' + required: + - data + CreateBookmarkResponseData: + properties: + tweet_bookmark_put: + type: string + required: + - tweet_bookmark_put CreateRetweet: properties: result: @@ -610,6 +621,18 @@ components: - ShowMoreThreads - Gap type: string + DeleteBookmarkResponse: + properties: + data: + $ref: '#/components/schemas/DeleteBookmarkResponseData' + required: + - data + DeleteBookmarkResponseData: + properties: + tweet_bookmark_delete: + type: string + required: + - tweet_bookmark_delete DeleteRetweet: properties: result: @@ -1043,7 +1066,6 @@ components: - original_info - media_key - ext_media_availability - - media_results MediaExtended: properties: additional_media_info: @@ -1112,7 +1134,6 @@ components: - url - sizes - original_info - - media_results MediaOriginalInfo: properties: focus_rects: @@ -1217,6 +1238,24 @@ components: required: - content_type - url + MediaVisibilityResults: + properties: + blurred_image_interstitial: + $ref: '#/components/schemas/MediaVisibilityResultsBlurredImageInterstitial' + required: + - blurred_image_interstitial + MediaVisibilityResultsBlurredImageInterstitial: + properties: + opacity: + type: number + text: + $ref: '#/components/schemas/TweetInterstitialText' + title: + $ref: '#/components/schemas/TweetInterstitialText' + required: + - opacity + - text + - title ModuleEntry: properties: clientEventInfo: @@ -2460,6 +2499,8 @@ components: limitedActionResults: additionalProperties: true type: object + mediaVisibilityResults: + $ref: '#/components/schemas/MediaVisibilityResults' tweet: $ref: '#/components/schemas/Tweet' tweetInterstitial: @@ -2590,6 +2631,8 @@ components: type: boolean legacy: $ref: '#/components/schemas/UserLegacy' + legacy_extended_profile: + $ref: '#/components/schemas/UserLegacyExtendedProfile' professional: $ref: '#/components/schemas/UserProfessional' profile_image_shape: @@ -2627,7 +2670,6 @@ components: - super_followed_by - super_following - profile_image_shape - - tipjar_settings UserFeatures: properties: mediatool_studio_library: @@ -2826,6 +2868,40 @@ components: - translator_type - verified - want_retweets + UserLegacyExtendedProfile: + properties: + birthdate: + $ref: '#/components/schemas/UserLegacyExtendedProfileBirthdate' + UserLegacyExtendedProfileBirthdate: + properties: + day: + type: integer + month: + type: integer + visibility: + enum: + - Self + - Public + - MutualFollow + - Followers + - Following + type: string + year: + type: integer + year_visibility: + enum: + - Self + - Public + - MutualFollow + - Followers + - Following + type: string + required: + - day + - month + - year + - visibility + - year_visibility UserMention: additionalProperties: true type: object @@ -4032,6 +4108,77 @@ paths: type: string tags: - tweet + /graphql/{pathQueryId}/CreateBookmark: + post: + description: create Bookmark + operationId: postCreateBookmark + parameters: + - in: path + name: pathQueryId + required: true + schema: + default: aoDbu3RHznuiSkQ9aNM67Q + example: aoDbu3RHznuiSkQ9aNM67Q + type: string + requestBody: + content: + application/json: + schema: + properties: + queryId: + default: aoDbu3RHznuiSkQ9aNM67Q + example: aoDbu3RHznuiSkQ9aNM67Q + type: string + variables: + properties: + tweet_id: + default: '1349129669258448897' + example: '1349129669258448897' + type: string + required: + - tweet_id + type: object + required: + - queryId + - variables + description: body + required: true + responses: + '200': + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/CreateBookmarkResponse' + - $ref: '#/components/schemas/Errors' + description: Successful operation + headers: + x-connection-hash: + schema: + type: string + x-rate-limit-limit: + schema: + type: integer + x-rate-limit-remaining: + schema: + type: integer + x-rate-limit-reset: + schema: + type: integer + x-response-time: + schema: + type: integer + x-tfe-preserve-body: + schema: + type: boolean + x-transaction-id: + schema: + type: string + x-twitter-response-tags: + schema: + type: string + tags: + - post /graphql/{pathQueryId}/CreateRetweet: post: description: create Retweet @@ -4335,6 +4482,77 @@ paths: type: string tags: - post + /graphql/{pathQueryId}/DeleteBookmark: + post: + description: delete Bookmark + operationId: postDeleteBookmark + parameters: + - in: path + name: pathQueryId + required: true + schema: + default: Wlmlj2-xzyS1GN3a6cj-mQ + example: Wlmlj2-xzyS1GN3a6cj-mQ + type: string + requestBody: + content: + application/json: + schema: + properties: + queryId: + default: Wlmlj2-xzyS1GN3a6cj-mQ + example: Wlmlj2-xzyS1GN3a6cj-mQ + type: string + variables: + properties: + tweet_id: + default: '1349129669258448897' + example: '1349129669258448897' + type: string + required: + - tweet_id + type: object + required: + - queryId + - variables + description: body + required: true + responses: + '200': + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/DeleteBookmarkResponse' + - $ref: '#/components/schemas/Errors' + description: Successful operation + headers: + x-connection-hash: + schema: + type: string + x-rate-limit-limit: + schema: + type: integer + x-rate-limit-remaining: + schema: + type: integer + x-rate-limit-reset: + schema: + type: integer + x-response-time: + schema: + type: integer + x-tfe-preserve-body: + schema: + type: boolean + x-transaction-id: + schema: + type: string + x-twitter-response-tags: + schema: + type: string + tags: + - post /graphql/{pathQueryId}/DeleteRetweet: post: description: delete Retweet diff --git a/dist/compatible_discriminator/openapi-3.0.yaml b/dist/compatible_discriminator/openapi-3.0.yaml index 682b8c1..40099f6 100644 --- a/dist/compatible_discriminator/openapi-3.0.yaml +++ b/dist/compatible_discriminator/openapi-3.0.yaml @@ -140,7 +140,6 @@ components: - preview_text - cover_media - metadata - - lifecycle_state ArticleResults: properties: result: @@ -546,6 +545,18 @@ components: - ctaBehavior - callbacks - clientEventInfo + CreateBookmarkResponse: + properties: + data: + $ref: '#/components/schemas/CreateBookmarkResponseData' + required: + - data + CreateBookmarkResponseData: + properties: + tweet_bookmark_put: + type: string + required: + - tweet_bookmark_put CreateRetweet: properties: result: @@ -610,6 +621,18 @@ components: - ShowMoreThreads - Gap type: string + DeleteBookmarkResponse: + properties: + data: + $ref: '#/components/schemas/DeleteBookmarkResponseData' + required: + - data + DeleteBookmarkResponseData: + properties: + tweet_bookmark_delete: + type: string + required: + - tweet_bookmark_delete DeleteRetweet: properties: result: @@ -1043,7 +1066,6 @@ components: - original_info - media_key - ext_media_availability - - media_results MediaExtended: properties: additional_media_info: @@ -1112,7 +1134,6 @@ components: - url - sizes - original_info - - media_results MediaOriginalInfo: properties: focus_rects: @@ -1217,6 +1238,24 @@ components: required: - content_type - url + MediaVisibilityResults: + properties: + blurred_image_interstitial: + $ref: '#/components/schemas/MediaVisibilityResultsBlurredImageInterstitial' + required: + - blurred_image_interstitial + MediaVisibilityResultsBlurredImageInterstitial: + properties: + opacity: + type: number + text: + $ref: '#/components/schemas/TweetInterstitialText' + title: + $ref: '#/components/schemas/TweetInterstitialText' + required: + - opacity + - text + - title ModuleEntry: properties: clientEventInfo: @@ -2460,6 +2499,8 @@ components: limitedActionResults: additionalProperties: true type: object + mediaVisibilityResults: + $ref: '#/components/schemas/MediaVisibilityResults' tweet: $ref: '#/components/schemas/Tweet' tweetInterstitial: @@ -2590,6 +2631,8 @@ components: type: boolean legacy: $ref: '#/components/schemas/UserLegacy' + legacy_extended_profile: + $ref: '#/components/schemas/UserLegacyExtendedProfile' professional: $ref: '#/components/schemas/UserProfessional' profile_image_shape: @@ -2627,7 +2670,6 @@ components: - super_followed_by - super_following - profile_image_shape - - tipjar_settings UserFeatures: properties: mediatool_studio_library: @@ -2826,6 +2868,40 @@ components: - translator_type - verified - want_retweets + UserLegacyExtendedProfile: + properties: + birthdate: + $ref: '#/components/schemas/UserLegacyExtendedProfileBirthdate' + UserLegacyExtendedProfileBirthdate: + properties: + day: + type: integer + month: + type: integer + visibility: + enum: + - Self + - Public + - MutualFollow + - Followers + - Following + type: string + year: + type: integer + year_visibility: + enum: + - Self + - Public + - MutualFollow + - Followers + - Following + type: string + required: + - day + - month + - year + - visibility + - year_visibility UserMention: additionalProperties: true type: object @@ -4030,6 +4106,75 @@ paths: type: string tags: - tweet + /graphql/{pathQueryId}/CreateBookmark: + post: + description: create Bookmark + operationId: postCreateBookmark + parameters: + - in: path + name: pathQueryId + required: true + schema: + default: aoDbu3RHznuiSkQ9aNM67Q + example: aoDbu3RHznuiSkQ9aNM67Q + type: string + requestBody: + content: + application/json: + schema: + properties: + queryId: + default: aoDbu3RHznuiSkQ9aNM67Q + example: aoDbu3RHznuiSkQ9aNM67Q + type: string + variables: + properties: + tweet_id: + default: '1349129669258448897' + example: '1349129669258448897' + type: string + required: + - tweet_id + type: object + required: + - queryId + - variables + description: body + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/CreateBookmarkResponse' + description: Successful operation + headers: + x-connection-hash: + schema: + type: string + x-rate-limit-limit: + schema: + type: integer + x-rate-limit-remaining: + schema: + type: integer + x-rate-limit-reset: + schema: + type: integer + x-response-time: + schema: + type: integer + x-tfe-preserve-body: + schema: + type: boolean + x-transaction-id: + schema: + type: string + x-twitter-response-tags: + schema: + type: string + tags: + - post /graphql/{pathQueryId}/CreateRetweet: post: description: create Retweet @@ -4329,6 +4474,75 @@ paths: type: string tags: - post + /graphql/{pathQueryId}/DeleteBookmark: + post: + description: delete Bookmark + operationId: postDeleteBookmark + parameters: + - in: path + name: pathQueryId + required: true + schema: + default: Wlmlj2-xzyS1GN3a6cj-mQ + example: Wlmlj2-xzyS1GN3a6cj-mQ + type: string + requestBody: + content: + application/json: + schema: + properties: + queryId: + default: Wlmlj2-xzyS1GN3a6cj-mQ + example: Wlmlj2-xzyS1GN3a6cj-mQ + type: string + variables: + properties: + tweet_id: + default: '1349129669258448897' + example: '1349129669258448897' + type: string + required: + - tweet_id + type: object + required: + - queryId + - variables + description: body + required: true + responses: + '200': + content: + application/json: + schema: + $ref: '#/components/schemas/DeleteBookmarkResponse' + description: Successful operation + headers: + x-connection-hash: + schema: + type: string + x-rate-limit-limit: + schema: + type: integer + x-rate-limit-remaining: + schema: + type: integer + x-rate-limit-reset: + schema: + type: integer + x-response-time: + schema: + type: integer + x-tfe-preserve-body: + schema: + type: boolean + x-transaction-id: + schema: + type: string + x-twitter-response-tags: + schema: + type: string + tags: + - post /graphql/{pathQueryId}/DeleteRetweet: post: description: delete Retweet diff --git a/dist/docs/openapi-3.0.yaml b/dist/docs/openapi-3.0.yaml index f7bbf97..66bcf01 100644 --- a/dist/docs/openapi-3.0.yaml +++ b/dist/docs/openapi-3.0.yaml @@ -140,7 +140,6 @@ components: - preview_text - cover_media - metadata - - lifecycle_state ArticleResults: properties: result: @@ -546,6 +545,18 @@ components: - ctaBehavior - callbacks - clientEventInfo + CreateBookmarkResponse: + properties: + data: + $ref: '#/components/schemas/CreateBookmarkResponseData' + required: + - data + CreateBookmarkResponseData: + properties: + tweet_bookmark_put: + type: string + required: + - tweet_bookmark_put CreateRetweet: properties: result: @@ -610,6 +621,18 @@ components: - ShowMoreThreads - Gap type: string + DeleteBookmarkResponse: + properties: + data: + $ref: '#/components/schemas/DeleteBookmarkResponseData' + required: + - data + DeleteBookmarkResponseData: + properties: + tweet_bookmark_delete: + type: string + required: + - tweet_bookmark_delete DeleteRetweet: properties: result: @@ -1043,7 +1066,6 @@ components: - original_info - media_key - ext_media_availability - - media_results MediaExtended: properties: additional_media_info: @@ -1112,7 +1134,6 @@ components: - url - sizes - original_info - - media_results MediaOriginalInfo: properties: focus_rects: @@ -1217,6 +1238,24 @@ components: required: - content_type - url + MediaVisibilityResults: + properties: + blurred_image_interstitial: + $ref: '#/components/schemas/MediaVisibilityResultsBlurredImageInterstitial' + required: + - blurred_image_interstitial + MediaVisibilityResultsBlurredImageInterstitial: + properties: + opacity: + type: number + text: + $ref: '#/components/schemas/TweetInterstitialText' + title: + $ref: '#/components/schemas/TweetInterstitialText' + required: + - opacity + - text + - title ModuleEntry: properties: clientEventInfo: @@ -2460,6 +2499,8 @@ components: limitedActionResults: additionalProperties: true type: object + mediaVisibilityResults: + $ref: '#/components/schemas/MediaVisibilityResults' tweet: $ref: '#/components/schemas/Tweet' tweetInterstitial: @@ -2590,6 +2631,8 @@ components: type: boolean legacy: $ref: '#/components/schemas/UserLegacy' + legacy_extended_profile: + $ref: '#/components/schemas/UserLegacyExtendedProfile' professional: $ref: '#/components/schemas/UserProfessional' profile_image_shape: @@ -2627,7 +2670,6 @@ components: - super_followed_by - super_following - profile_image_shape - - tipjar_settings UserFeatures: properties: mediatool_studio_library: @@ -2826,6 +2868,40 @@ components: - translator_type - verified - want_retweets + UserLegacyExtendedProfile: + properties: + birthdate: + $ref: '#/components/schemas/UserLegacyExtendedProfileBirthdate' + UserLegacyExtendedProfileBirthdate: + properties: + day: + type: integer + month: + type: integer + visibility: + enum: + - Self + - Public + - MutualFollow + - Followers + - Following + type: string + year: + type: integer + year_visibility: + enum: + - Self + - Public + - MutualFollow + - Followers + - Following + type: string + required: + - day + - month + - year + - visibility + - year_visibility UserMention: additionalProperties: true type: object @@ -4134,6 +4210,77 @@ paths: type: string tags: - tweet + /graphql/{pathQueryId}/CreateBookmark: + post: + description: create Bookmark + operationId: postCreateBookmark + parameters: + - in: path + name: pathQueryId + required: true + schema: + default: aoDbu3RHznuiSkQ9aNM67Q + example: aoDbu3RHznuiSkQ9aNM67Q + type: string + requestBody: + content: + application/json: + schema: + properties: + queryId: + default: aoDbu3RHznuiSkQ9aNM67Q + example: aoDbu3RHznuiSkQ9aNM67Q + type: string + variables: + properties: + tweet_id: + default: '1349129669258448897' + example: '1349129669258448897' + type: string + required: + - tweet_id + type: object + required: + - queryId + - variables + description: body + required: true + responses: + '200': + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/CreateBookmarkResponse' + - $ref: '#/components/schemas/Errors' + description: Successful operation + headers: + x-connection-hash: + schema: + type: string + x-rate-limit-limit: + schema: + type: integer + x-rate-limit-remaining: + schema: + type: integer + x-rate-limit-reset: + schema: + type: integer + x-response-time: + schema: + type: integer + x-tfe-preserve-body: + schema: + type: boolean + x-transaction-id: + schema: + type: string + x-twitter-response-tags: + schema: + type: string + tags: + - post /graphql/{pathQueryId}/CreateRetweet: post: description: create Retweet @@ -4437,6 +4584,77 @@ paths: type: string tags: - post + /graphql/{pathQueryId}/DeleteBookmark: + post: + description: delete Bookmark + operationId: postDeleteBookmark + parameters: + - in: path + name: pathQueryId + required: true + schema: + default: Wlmlj2-xzyS1GN3a6cj-mQ + example: Wlmlj2-xzyS1GN3a6cj-mQ + type: string + requestBody: + content: + application/json: + schema: + properties: + queryId: + default: Wlmlj2-xzyS1GN3a6cj-mQ + example: Wlmlj2-xzyS1GN3a6cj-mQ + type: string + variables: + properties: + tweet_id: + default: '1349129669258448897' + example: '1349129669258448897' + type: string + required: + - tweet_id + type: object + required: + - queryId + - variables + description: body + required: true + responses: + '200': + content: + application/json: + schema: + oneOf: + - $ref: '#/components/schemas/DeleteBookmarkResponse' + - $ref: '#/components/schemas/Errors' + description: Successful operation + headers: + x-connection-hash: + schema: + type: string + x-rate-limit-limit: + schema: + type: integer + x-rate-limit-remaining: + schema: + type: integer + x-rate-limit-reset: + schema: + type: integer + x-response-time: + schema: + type: integer + x-tfe-preserve-body: + schema: + type: boolean + x-transaction-id: + schema: + type: string + x-twitter-response-tags: + schema: + type: string + tags: + - post /graphql/{pathQueryId}/DeleteRetweet: post: description: delete Retweet