1
Fork 0
mirror of https://github.com/thegeneralist01/twitter-openapi synced 2026-01-11 15:40:26 +01:00
Signed-off-by: ふぁ <yuki@yuki0311.com>
This commit is contained in:
ふぁ 2023-06-15 14:01:11 +09:00
parent 6fbfc323b3
commit 3dbdd17fbb
No known key found for this signature in database
GPG key ID: 83A8A5E74872A8AA
74 changed files with 16 additions and 9401 deletions

181
dist/compatible/schemas/content.yaml vendored Normal file
View file

@ -0,0 +1,181 @@
components:
schemas:
ContentEntryType:
enum:
- TimelineTimelineItem
- TimelineTimelineCursor
- TimelineTimelineModule
type: string
ContentItemType:
enum:
- TimelineTweet
- TimelineTimelineCursor
- TimelineUser
type: string
ContentUnion:
discriminator:
mapping":
TimelineTimelineCursor: '#/components/schemas/TimelineTimelineCursor'
TimelineTimelineItem: '#/components/schemas/TimelineTimelineItem'
TimelineTimelineModule: '#/components/schemas/TimelineTimelineModule'
propertyName: entryType
oneOf:
- $ref: '#/components/schemas/TimelineTimelineItem'
- $ref: '#/components/schemas/TimelineTimelineModule'
- $ref: '#/components/schemas/TimelineTimelineCursor'
ItemContentUnion:
discriminator:
mapping":
TimelineTimelineCursor: '#/components/schemas/TimelineTimelineCursor'
TimelineTweet: '#/components/schemas/TimelineTweet'
TimelineUser: '#/components/schemas/TimelineUser'
propertyName: itemType
oneOf:
- $ref: '#/components/schemas/TimelineTweet'
- $ref: '#/components/schemas/TimelineTimelineCursor'
- $ref: '#/components/schemas/TimelineUser'
ItemResult:
properties:
__typename:
$ref: ./typename.yaml#/components/schemas/TypeName
result:
$ref: ./tweet.yaml#/components/schemas/TweetUnion
required:
- result
ModuleEntry:
properties:
clientEventInfo:
type: object
itemContent:
$ref: '#/components/schemas/ItemContentUnion'
required:
- clientEventInfo
- itemContent
ModuleItem:
properties:
entryId:
pattern: ^[a-z\-]+[0-9]+$
type: string
item:
$ref: '#/components/schemas/ModuleEntry'
required:
- entryId
- item
SocialContext:
properties:
contextType:
type: string
text:
type: string
type:
type: string
type: object
TimelineTimelineCursor:
properties:
__typename:
$ref: ./typename.yaml#/components/schemas/TypeName
cursorType:
enum:
- Top
- Bottom
- ShowMore
- ShowMoreThreads
- Gap
type: string
entryType:
$ref: '#/components/schemas/ContentEntryType'
type: string
itemType:
$ref: '#/components/schemas/ContentEntryType'
type: string
value:
type: string
required:
- __typename
- cursorType
- value
TimelineTimelineItem:
properties:
__typename:
$ref: ./typename.yaml#/components/schemas/TypeName
clientEventInfo:
type: object
entryType:
$ref: '#/components/schemas/ContentEntryType'
type: string
feedbackInfo:
type: object
itemContent:
$ref: '#/components/schemas/ItemContentUnion'
required:
- __typename
- entryType
- itemContent
TimelineTimelineModule:
properties:
__typename:
$ref: ./typename.yaml#/components/schemas/TypeName
clientEventInfo:
type: object
displayType:
type: string
entryType:
$ref: '#/components/schemas/ContentEntryType'
type: string
footer:
type: object
header:
type: object
items:
items:
$ref: '#/components/schemas/ModuleItem'
type: array
required:
- __typename
- entryType
- displayType
- clientEventInfo
TimelineTweet:
properties:
SocialContext:
$ref: '#/components/schemas/SocialContext'
__typename:
$ref: ./typename.yaml#/components/schemas/TypeName
itemType:
$ref: '#/components/schemas/ContentItemType'
type: string
promotedMetadata:
type: object
tweetDisplayType:
type: string
tweet_results:
$ref: '#/components/schemas/ItemResult'
required:
- __typename
- itemType
- tweetDisplayType
- tweet_results
TimelineUser:
properties:
SocialContext:
$ref: '#/components/schemas/SocialContext'
__typename:
$ref: ./typename.yaml#/components/schemas/TypeName
itemType:
$ref: '#/components/schemas/ContentItemType'
type: string
userDisplayType:
type: string
user_results:
$ref: ./user.yaml#/components/schemas/UserResults
required:
- __typename
- itemType
- socialContext
- userDisplayType
- user_results
info:
title: Twitter OpenAPI
version: 0.0.1
openapi: 3.0.3
paths: {}

13
dist/compatible/schemas/general.yaml vendored Normal file
View file

@ -0,0 +1,13 @@
components:
schemas:
TwitterTimeFormat:
example: Sat Dec 31 23:59:59 +0000 2023
pattern: ^(Sun|Mon|Tue|Wed|Thu|Fri|Sat) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)
(0[1-9]|[12][0-9]|3[01]) (0[0-9]|1[0-9]|2[0-3]):([0-5][0-9]):([0-5][0-9])
([+-][0-9]{4}) ([0-9]{4})$
type: string
info:
title: Twitter OpenAPI
version: 0.0.1
openapi: 3.0.3
paths: {}

View file

@ -0,0 +1,83 @@
components:
schemas:
InstructionType:
enum:
- TimelineAddEntries
- TimelineClearCache
- TimelinePinEntry
- TimelineTerminateTimeline
type: string
InstructionUnion:
discriminator:
mapping":
TimelineAddEntries: '#/components/schemas/TimelineAddEntries'
TimelineClearCache: '#/components/schemas/TimelineClearCache'
TimelinePinEntry: '#/components/schemas/TimelinePinEntry'
TimelineTerminateTimeline: '#/components/schemas/TimelineTerminateTimeline'
propertyName: type
oneOf:
- $ref: '#/components/schemas/TimelineAddEntries'
- $ref: '#/components/schemas/TimelineClearCache'
- $ref: '#/components/schemas/TimelinePinEntry'
- $ref: '#/components/schemas/TimelineTerminateTimeline'
TimelineAddEntries:
properties:
entries:
items:
$ref: '#/components/schemas/TimelineAddEntry'
type: array
type:
$ref: '#/components/schemas/InstructionType'
type: string
required:
- type
- entries
TimelineAddEntry:
properties:
content:
$ref: ./content.yaml#/components/schemas/ContentUnion
entryId:
pattern: ^[a-z\-]+[0-9]+$
type: string
sortIndex:
pattern: '[0-9]+$'
type: string
required:
- content
- entryId
- sortIndex
TimelineClearCache:
properties:
type:
$ref: '#/components/schemas/InstructionType'
type: string
required:
- type
TimelinePinEntry:
properties:
entry:
$ref: '#/components/schemas/TimelineAddEntry'
type:
$ref: '#/components/schemas/InstructionType'
type: string
required:
- type
- entry
TimelineTerminateTimeline:
properties:
direction:
enum:
- Top
- Bottom
type: string
type:
$ref: '#/components/schemas/InstructionType'
type: string
required:
- type
- direction
info:
title: Twitter OpenAPI
version: 0.0.1
openapi: 3.0.3
paths: {}

25
dist/compatible/schemas/timeline.yaml vendored Normal file
View file

@ -0,0 +1,25 @@
components:
schemas:
Timeline:
properties:
instructions:
items:
$ref: ./../schemas/instruction.yaml#/components/schemas/InstructionUnion
type: array
metadata:
type: object
responseObjects:
type: object
required:
- instructions
TimelineV2:
properties:
timeline:
$ref: '#/components/schemas/Timeline'
required:
- timeline
info:
title: Twitter OpenAPI
version: 0.0.1
openapi: 3.0.3
paths: {}

316
dist/compatible/schemas/tweet.yaml vendored Normal file
View file

@ -0,0 +1,316 @@
components:
schemas:
Entities:
properties:
hashtags:
items:
$ref: '#/components/schemas/Hashtag'
type: array
media:
items:
$ref: '#/components/schemas/Media'
type: array
symbols:
items:
$ref: '#/components/schemas/Symbol'
type: array
urls:
items:
$ref: '#/components/schemas/Url'
type: array
user_mentions:
items:
$ref: '#/components/schemas/UserMention'
type: array
required:
- hashtags
- symbols
- user_mentions
- urls
ExtendedEntities:
properties:
media:
items:
$ref: '#/components/schemas/Media'
type: array
required:
- media
Hashtag:
type: object
Media:
properties:
display_url:
format: uri
type: string
expanded_url:
format: uri
type: string
ext_media_availability:
type: object
id_str:
pattern: ^[0-9]+$
type: string
indices:
items:
type: integer
type: array
media_key:
pattern: ^[0-9]+_[0-9]+$
type: string
media_url_https:
format: uri
type: string
original_info:
properties:
focus_rects:
items:
type: object
type: array
height:
type: integer
width:
type: integer
type: object
sizes:
type: object
type:
type: string
url:
format: uri
type: string
required:
- id_str
- indices
- media_url_https
- url
- display_url
- expanded_url
- type
- sizes
- original_info
Symbol:
type: object
Tweet:
properties:
__typename:
$ref: ./typename.yaml#/components/schemas/TypeName
card:
properties:
legacy:
properties:
binding_values:
items:
properties:
key:
type: string
value:
properties:
boolean_value:
type: boolean
scribe_key:
type: string
string_value:
type: string
type:
type: string
required:
- type
type: object
required:
- key
- value
type: object
type: array
name:
type: string
url:
type: string
required:
- binding_values
- name
- url
type: object
rest_id:
type: string
type: object
core:
$ref: ./user.yaml#/components/schemas/UserResultCore
edit_control:
properties:
edit_tweet_ids:
items:
pattern: ^[0-9]+$
type: string
type: array
editable_until_msecs:
pattern: ^[0-9]+$
type: string
edits_remaining:
pattern: ^[0-9]+$
type: string
is_edit_eligible:
type: boolean
type: object
edit_prespective:
properties:
favorited:
type: boolean
retweeted:
type: boolean
type: object
is_translatable:
default: false
type: boolean
legacy:
$ref: '#/components/schemas/TweetLegacy'
quoted_status_result:
$ref: ./content.yaml#/components/schemas/ItemResult
rest_id:
pattern: ^[0-9]+$
type: string
unmention_data:
type: object
views:
properties:
count:
pattern: ^[0-9]+$
type: string
state:
type: string
type: object
required:
- rest_id
- core
- edit_control
- edit_prespective
- is_translatable
- legacy
- views
TweetLegacy:
properties:
bookmark_count:
type: integer
bookmarked:
type: boolean
conversation_id_str:
pattern: ^[0-9]+$
type: string
created_at:
$ref: ./general.yaml#/components/schemas/TwitterTimeFormat
display_text_range:
items:
type: integer
type: array
entities:
$ref: '#/components/schemas/Entities'
extended_entities:
$ref: '#/components/schemas/ExtendedEntities'
favorite_count:
type: integer
favorited:
type: boolean
full_text:
type: string
id_str:
pattern: ^[0-9]+$
type: string
is_quote_status:
type: boolean
lang:
type: string
possibly_sensitive:
default: false
type: boolean
possibly_sensitive_editable:
default: false
type: boolean
quote_count:
type: integer
reply_count:
type: integer
retweet_count:
type: integer
retweeted:
type: boolean
retweeted_status_result:
$ref: ./content.yaml#/components/schemas/ItemResult
self_thread:
properties:
id_str:
pattern: ^[0-9]+$
type: string
required:
- id_str
type: object
user_id_str:
pattern: ^[0-9]+$
type: string
required:
- bookmark_count
- bookmarked
- conversation_id_str
- created_at
- display_text_range
- entities
- favorite_count
- favorited
- full_text
- is_quote_status
- lang
- quote_count
- reply_count
- retweet_count
- retweeted
- user_id_str
- id_str
TweetTombstone:
properties:
__typename:
$ref: ./typename.yaml#/components/schemas/TypeName
TweetUnion:
discriminator:
mapping":
Tweet: '#/components/schemas/Tweet'
TweetTombstone: '#/components/schemas/TweetTombstone'
TweetWithVisibilityResults: '#/components/schemas/TweetWithVisibilityResults'
propertyName: __typename
oneOf:
- $ref: '#/components/schemas/Tweet'
- $ref: '#/components/schemas/TweetWithVisibilityResults'
- $ref: '#/components/schemas/TweetTombstone'
TweetWithVisibilityResults:
properties:
__typename:
$ref: ./typename.yaml#/components/schemas/TypeName
tweet:
$ref: '#/components/schemas/Tweet'
required:
- __typename
- tweet
Url:
properties:
display_url:
type: string
expanded_url:
format: uri
type: string
indices:
items:
type: integer
type: array
url:
format: uri
type: string
required:
- url
- indices
- expanded_url
- display_url
type: object
UserMention:
type: object
info:
title: Twitter OpenAPI
version: 0.0.1
openapi: 3.0.3
paths: {}

19
dist/compatible/schemas/typename.yaml vendored Normal file
View file

@ -0,0 +1,19 @@
components:
schemas:
TypeName:
enum:
- TimelineTweet
- TimelineTimelineItem
- TimelineUser
- TimelineTimelineCursor
- TweetWithVisibilityResults
- TimelineTimelineModule
- TweetTombstone
- Tweet
- User
type: string
info:
title: Twitter OpenAPI
version: 0.0.1
openapi: 3.0.3
paths: {}

206
dist/compatible/schemas/user.yaml vendored Normal file
View file

@ -0,0 +1,206 @@
components:
schemas:
User:
properties:
__typename:
$ref: ./typename.yaml#/components/schemas/TypeName
affiliates_highlighted_label:
type: object
business_account:
type: object
has_graduated_access:
type: boolean
has_nft_avatar:
default: false
type: boolean
id:
pattern: ^[a-z\-]+[0-9]+$
type: string
is_blue_verified:
default: false
type: boolean
legacy:
$ref: '#/components/schemas/UserLegacy'
rest_id:
pattern: ^[0-9]+$
type: string
super_follow_eligible:
default: false
type: boolean
super_followed_by:
default: false
type: boolean
super_following:
default: false
type: boolean
required:
- __typename
- affiliates_highlighted_label
- id
- is_blue_verified
- legacy
- rest_id
- super_follow_eligible
- super_followed_by
- super_following
UserLegacy:
properties:
blocked_by:
default: false
type: boolean
blocking:
default: false
type: boolean
can_dm:
default: false
type: boolean
can_media_tag:
default: false
type: boolean
created_at:
$ref: ./general.yaml#/components/schemas/TwitterTimeFormat
default_profile:
default: false
type: boolean
default_profile_image:
default: false
type: boolean
description:
type: string
entities:
type: object
fast_followers_count:
type: integer
favourites_count:
default: 0
type: integer
follow_request_sent:
default: false
type: boolean
followed_by:
default: false
type: boolean
followers_count:
default: 0
type: integer
following:
default: false
type: boolean
friends_count:
default: 0
type: integer
has_custom_timelines:
default: false
type: boolean
is_translator:
default: false
type: boolean
listed_count:
default: 0
type: integer
location:
type: string
media_count:
default: 0
type: integer
muting:
default: false
type: boolean
name:
type: string
normal_followers_count:
default: 0
type: integer
notifications:
default: false
type: boolean
pinned_tweet_ids_str:
items:
type: string
type: array
possibly_sensitive:
default: false
type: boolean
profile_banner_extensions:
type: object
profile_banner_url:
format: uri
type: string
profile_image_extensions:
type: object
profile_image_url_https:
format: uri
type: string
profile_interstitial_type:
type: string
protected:
default: false
type: boolean
screen_name:
type: string
statuses_count:
default: 0
type: integer
translator_type:
type: string
url:
type: string
verified:
type: boolean
want_retweets:
default: false
type: boolean
required:
- blocked_by
- blocking
- can_dm
- can_media_tag
- created_at
- default_profile
- default_profile_image
- description
- entities
- fast_followers_count
- favourites_count
- follow_request_sent
- followed_by
- followers_count
- following
- friends_count
- has_custom_timelines
- is_translator
- listed_count
- location
- media_count
- muting
- name
- normal_followers_count
- notifications
- pinned_tweet_ids_str
- possibly_sensitive
- profile_image_url_https
- profile_interstitial_type
- protected
- screen_name
- status
- statuses_count
- translator_type
- verified
- want_retweets
UserResultCore:
properties:
user_results:
$ref: '#/components/schemas/UserResults'
required:
- user_results
UserResults:
properties:
result:
$ref: '#/components/schemas/User'
required:
- result
info:
title: Twitter OpenAPI
version: 0.0.1
openapi: 3.0.3
paths: {}