From c19d43c42a1e7b1848f3406c5c82416984d6ccd8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E3=81=B5=E3=81=81?= Date: Wed, 7 Feb 2024 17:55:08 +0900 Subject: [PATCH] update chemas MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: ふぁ --- src/openapi/schemas/content.yaml | 23 +++++++-- src/openapi/schemas/tweet.yaml | 87 ++++++++++++++++++++++++++++++-- src/openapi/schemas/user.yaml | 41 +++++++++++++++ 3 files changed, 144 insertions(+), 7 deletions(-) diff --git a/src/openapi/schemas/content.yaml b/src/openapi/schemas/content.yaml index 3619356..78cf6ce 100644 --- a/src/openapi/schemas/content.yaml +++ b/src/openapi/schemas/content.yaml @@ -81,6 +81,7 @@ components: - "__typename" - "cursorType" - "value" + - "stopOnEmptyResponse" properties: __typename: $ref: "./typename.yaml#/components/schemas/TypeName" # TimelineTimelineCursor @@ -92,6 +93,9 @@ components: $ref: "#/components/schemas/CursorType" value: type: string + stopOnEmptyResponse: + type: boolean + default: false # ================= Module ================= @@ -163,7 +167,7 @@ components: type: string tweet_results: $ref: "#/components/schemas/ItemResult" - SocialContext: + socialContext: $ref: "#/components/schemas/SocialContext" promotedMetadata: type: object @@ -173,7 +177,6 @@ components: required: - "__typename" - "itemType" - - "socialContext" - "userDisplayType" - "user_results" properties: @@ -181,7 +184,7 @@ components: $ref: "./typename.yaml#/components/schemas/TypeName" # TimelineUser itemType: $ref: "#/components/schemas/ContentItemType" # TimelineUser - SocialContext: + socialContext: $ref: "#/components/schemas/SocialContext" userDisplayType: type: string @@ -201,10 +204,24 @@ components: properties: contextType: type: string # enum + enum: ["Follow"] text: type: string type: type: string # enum + enum: ["TimelineGeneralContext"] + landingUrl: + $ref: "#/components/schemas/SocialContextLandingUrl" + + SocialContextLandingUrl: + type: object + properties: + urlType: + type: string # enum + enum: ["DeepLink"] + Url: + type: string # twitter://user?id=900282258736545792 + format: uri TimelinePrompt: properties: diff --git a/src/openapi/schemas/tweet.yaml b/src/openapi/schemas/tweet.yaml index c5a6733..1284ca5 100644 --- a/src/openapi/schemas/tweet.yaml +++ b/src/openapi/schemas/tweet.yaml @@ -80,6 +80,8 @@ components: $ref: "#/components/schemas/NoteTweet" quick_promote_eligibility: type: object + unified_card: + $ref: "#/components/schemas/UnifiedCard" TweetEditControl: properties: @@ -220,6 +222,14 @@ components: type: string enum: [Bold, Italic] + UnifiedCard: + required: + - "card_fetch_state" + properties: + card_fetch_state: + type: string + enum: [NoCard] + BirdwatchPivot: required: - "destinationUrl" @@ -333,6 +343,46 @@ components: items: $ref: "#/components/schemas/TweetCardLegacyBindingValue" + # {'platform': {'audience': {'name': 'production'}, 'device': {'name': 'Swift', 'version': '12'}}} + card_platform: + $ref: "#/components/schemas/TweetCardPlatformData" + + TweetCardPlatformData: + required: + - "platform" + properties: + platform: + $ref: "#/components/schemas/TweetCardPlatform" + + TweetCardPlatform: + required: + - "audience" + - "device" + properties: + audience: + $ref: "#/components/schemas/TweetCardPlatformAudience" + device: + $ref: "#/components/schemas/TweetCardPlatformDevice" + + TweetCardPlatformAudience: + required: + - "name" + properties: + name: + type: string + enum: [production] + + TweetCardPlatformDevice: + required: + - "name" + - "version" + properties: + name: + type: string # enum Swift + version: + type: string + pattern: "^[0-9]+$" + TweetCardLegacyBindingValue: required: - "key" @@ -427,6 +477,16 @@ components: $ref: "#/components/schemas/SelfThread" extended_entities: $ref: "#/components/schemas/ExtendedEntities" + scopes: + $ref: "#/components/schemas/TweetLegacyScopes" + in_reply_to_screen_name: + type: string + in_reply_to_status_id_str: + type: string + pattern: "^[0-9]+$" + in_reply_to_user_id_str: + type: string + pattern: "^[0-9]+$" SelfThread: required: @@ -506,6 +566,8 @@ components: # - "features" - "sizes" - "original_info" + - "media_key" + - "ext_media_availability" properties: display_url: type: string @@ -535,6 +597,23 @@ components: $ref: "#/components/schemas/MediaSizes" original_info: $ref: "#/components/schemas/MediaOriginalInfo" + media_key: + type: string + ext_media_availability: + $ref: "#/components/schemas/ExtMediaAvailability" + video_info: + type: object + additionalProperties: true # todo + additional_media_info: + type: object + additionalProperties: true # todo + + TweetLegacyScopes: + required: + - "followers" + properties: + followers: + type: boolean ExtendedEntities: required: @@ -587,9 +666,9 @@ components: additional_media_info: $ref: "#/components/schemas/AdditionalMediaInfo" mediaStats: - $ref: "#/components/schemas/mediaStats" + $ref: "#/components/schemas/MediaStats" ext_media_availability: - $ref: "#/components/schemas/extMediaAvailability" + $ref: "#/components/schemas/ExtMediaAvailability" features: type: object sizes: @@ -666,14 +745,14 @@ components: monetizable: type: boolean - mediaStats: + MediaStats: required: - "viewCount" properties: viewCount: type: integer - extMediaAvailability: + ExtMediaAvailability: # required: # - "status" properties: diff --git a/src/openapi/schemas/user.yaml b/src/openapi/schemas/user.yaml index 0e48b57..7bfc027 100644 --- a/src/openapi/schemas/user.yaml +++ b/src/openapi/schemas/user.yaml @@ -38,6 +38,7 @@ components: - "super_follow_eligible" - "super_followed_by" - "super_following" + - "profile_image_shape" properties: __typename: @@ -73,6 +74,43 @@ components: super_following: type: boolean default: false + profile_image_shape: + type: string + enum: + - "Circle" + - "Square" + professional: + $ref: "#/components/schemas/UserProfessional" + + UserProfessional: + required: + - "rest_id" + - "professional_type" + - "category" + properties: + rest_id: + type: string + pattern: "^[0-9]+$" + professional_type: + type: string + enum: ["Business"] + category: + type: array + items: + $ref: "#/components/schemas/UserProfessionalCategory" + + UserProfessionalCategory: + required: + - "id" + - "name" + - "icon_name" + properties: + id: + type: integer + name: + type: string # enum + icon_name: + type: string # IconBriefcaseStroke ? UserLegacy: required: @@ -219,6 +257,9 @@ components: want_retweets: type: boolean default: false + verified_type: + type: string + enum: ["Business"] UserUnavailable: required: