twitter-openapi-typescript-generated 0.0.11 → 0.0.13
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.openapi-generator/FILES +18 -0
- package/LICENSE +31 -31
- package/LICENSE.AGPL +660 -660
- package/README.md +2 -2
- package/dist/apis/DefaultApi.d.ts.map +1 -1
- package/dist/apis/DefaultApi.js +86 -18
- package/dist/apis/DefaultApi.js.map +1 -1
- package/dist/apis/OtherApi.d.ts.map +1 -1
- package/dist/apis/OtherApi.js +43 -9
- package/dist/apis/OtherApi.js.map +1 -1
- package/dist/apis/PostApi.d.ts.map +1 -1
- package/dist/apis/PostApi.js +264 -60
- package/dist/apis/PostApi.js.map +1 -1
- package/dist/apis/TweetApi.d.ts +1 -2
- package/dist/apis/TweetApi.d.ts.map +1 -1
- package/dist/apis/TweetApi.js +479 -111
- package/dist/apis/TweetApi.js.map +1 -1
- package/dist/apis/UserApi.d.ts +1 -0
- package/dist/apis/UserApi.d.ts.map +1 -1
- package/dist/apis/UserApi.js +92 -18
- package/dist/apis/UserApi.js.map +1 -1
- package/dist/apis/UserListApi.d.ts +0 -1
- package/dist/apis/UserListApi.d.ts.map +1 -1
- package/dist/apis/UserListApi.js +215 -51
- package/dist/apis/UserListApi.js.map +1 -1
- package/dist/apis/UsersApi.d.ts.map +1 -1
- package/dist/apis/UsersApi.js +43 -9
- package/dist/apis/UsersApi.js.map +1 -1
- package/dist/apis/V11GetApi.d.ts.map +1 -1
- package/dist/apis/V11GetApi.js +86 -18
- package/dist/apis/V11GetApi.js.map +1 -1
- package/dist/apis/V11PostApi.d.ts.map +1 -1
- package/dist/apis/V11PostApi.js +72 -6
- package/dist/apis/V11PostApi.js.map +1 -1
- package/dist/apis/V20GetApi.d.ts.map +1 -1
- package/dist/apis/V20GetApi.js +43 -9
- package/dist/apis/V20GetApi.js.map +1 -1
- package/dist/models/BirdwatchEntity.d.ts +45 -0
- package/dist/models/BirdwatchEntity.d.ts.map +1 -0
- package/dist/models/BirdwatchEntity.js +58 -0
- package/dist/models/BirdwatchEntity.js.map +1 -0
- package/dist/models/BirdwatchEntityRef.d.ts +58 -0
- package/dist/models/BirdwatchEntityRef.d.ts.map +1 -0
- package/dist/models/BirdwatchEntityRef.js +69 -0
- package/dist/models/BirdwatchEntityRef.js.map +1 -0
- package/dist/models/BirdwatchPivot.d.ts +91 -0
- package/dist/models/BirdwatchPivot.d.ts.map +1 -0
- package/dist/models/BirdwatchPivot.js +87 -0
- package/dist/models/BirdwatchPivot.js.map +1 -0
- package/dist/models/BirdwatchPivotFooter.d.ts +39 -0
- package/dist/models/BirdwatchPivotFooter.d.ts.map +1 -0
- package/dist/models/BirdwatchPivotFooter.js +55 -0
- package/dist/models/BirdwatchPivotFooter.js.map +1 -0
- package/dist/models/BirdwatchPivotNote.d.ts +32 -0
- package/dist/models/BirdwatchPivotNote.d.ts.map +1 -0
- package/dist/models/BirdwatchPivotNote.js +51 -0
- package/dist/models/BirdwatchPivotNote.js.map +1 -0
- package/dist/models/BirdwatchPivotSubtitle.d.ts +39 -0
- package/dist/models/BirdwatchPivotSubtitle.d.ts.map +1 -0
- package/dist/models/BirdwatchPivotSubtitle.js +55 -0
- package/dist/models/BirdwatchPivotSubtitle.js.map +1 -0
- package/dist/models/ContentItemType.d.ts +1 -0
- package/dist/models/ContentItemType.d.ts.map +1 -1
- package/dist/models/ContentItemType.js +2 -1
- package/dist/models/ContentItemType.js.map +1 -1
- package/dist/models/CoverCta.d.ts +1 -1
- package/dist/models/CoverCta.d.ts.map +1 -1
- package/dist/models/CoverCta.js +1 -2
- package/dist/models/CoverCta.js.map +1 -1
- package/dist/models/DeleteRetweet.d.ts +33 -0
- package/dist/models/DeleteRetweet.d.ts.map +1 -0
- package/dist/models/DeleteRetweet.js +52 -0
- package/dist/models/DeleteRetweet.js.map +1 -0
- package/dist/models/DeleteRetweetResponseResult.d.ts +33 -0
- package/dist/models/DeleteRetweetResponseResult.d.ts.map +1 -0
- package/dist/models/DeleteRetweetResponseResult.js +52 -0
- package/dist/models/DeleteRetweetResponseResult.js.map +1 -0
- package/dist/models/ErrorResponse.d.ts +33 -0
- package/dist/models/ErrorResponse.d.ts.map +1 -0
- package/dist/models/ErrorResponse.js +52 -0
- package/dist/models/ErrorResponse.js.map +1 -0
- package/dist/models/ExtMediaAvailability.d.ts +7 -0
- package/dist/models/ExtMediaAvailability.d.ts.map +1 -1
- package/dist/models/ExtMediaAvailability.js +4 -1
- package/dist/models/ExtMediaAvailability.js.map +1 -1
- package/dist/models/Extensions.d.ts +57 -0
- package/dist/models/Extensions.d.ts.map +1 -0
- package/dist/models/Extensions.js +64 -0
- package/dist/models/Extensions.js.map +1 -0
- package/dist/models/ItemContentUnion.d.ts +3 -0
- package/dist/models/ItemContentUnion.d.ts.map +1 -1
- package/dist/models/ItemContentUnion.js +5 -0
- package/dist/models/ItemContentUnion.js.map +1 -1
- package/dist/models/ListTweetsTimeline.d.ts +1 -1
- package/dist/models/ListTweetsTimeline.d.ts.map +1 -1
- package/dist/models/ListTweetsTimeline.js +2 -2
- package/dist/models/ListTweetsTimeline.js.map +1 -1
- package/dist/models/MediaExtended.d.ts +1 -1
- package/dist/models/MediaExtended.d.ts.map +1 -1
- package/dist/models/MediaExtended.js +1 -2
- package/dist/models/MediaExtended.js.map +1 -1
- package/dist/models/NoteTweet.d.ts +39 -0
- package/dist/models/NoteTweet.d.ts.map +1 -0
- package/dist/models/NoteTweet.js +55 -0
- package/dist/models/NoteTweet.js.map +1 -0
- package/dist/models/NoteTweetResult.d.ts +33 -0
- package/dist/models/NoteTweetResult.d.ts.map +1 -0
- package/dist/models/NoteTweetResult.js +52 -0
- package/dist/models/NoteTweetResult.js.map +1 -0
- package/dist/models/NoteTweetResultData.d.ts +59 -0
- package/dist/models/NoteTweetResultData.d.ts.map +1 -0
- package/dist/models/NoteTweetResultData.js +65 -0
- package/dist/models/NoteTweetResultData.js.map +1 -0
- package/dist/models/NoteTweetResultMedia.d.ts +32 -0
- package/dist/models/NoteTweetResultMedia.d.ts.map +1 -0
- package/dist/models/NoteTweetResultMedia.js +51 -0
- package/dist/models/NoteTweetResultMedia.js.map +1 -0
- package/dist/models/NoteTweetResultRichText.d.ts +33 -0
- package/dist/models/NoteTweetResultRichText.d.ts.map +1 -0
- package/dist/models/NoteTweetResultRichText.js +52 -0
- package/dist/models/NoteTweetResultRichText.js.map +1 -0
- package/dist/models/NoteTweetResultRichTextTag.d.ts +52 -0
- package/dist/models/NoteTweetResultRichTextTag.d.ts.map +1 -0
- package/dist/models/NoteTweetResultRichTextTag.js +64 -0
- package/dist/models/NoteTweetResultRichTextTag.js.map +1 -0
- package/dist/models/PostCreateTweetRequestFeatures.d.ts +9 -15
- package/dist/models/PostCreateTweetRequestFeatures.d.ts.map +1 -1
- package/dist/models/PostCreateTweetRequestFeatures.js +9 -12
- package/dist/models/PostCreateTweetRequestFeatures.js.map +1 -1
- package/dist/models/PostCreateTweetRequestVariablesMedia.d.ts +3 -2
- package/dist/models/PostCreateTweetRequestVariablesMedia.d.ts.map +1 -1
- package/dist/models/PostCreateTweetRequestVariablesMedia.js +3 -2
- package/dist/models/PostCreateTweetRequestVariablesMedia.js.map +1 -1
- package/dist/models/PostCreateTweetRequestVariablesMediaMediaEntitiesInner.d.ts +38 -0
- package/dist/models/PostCreateTweetRequestVariablesMediaMediaEntitiesInner.d.ts.map +1 -0
- package/dist/models/PostCreateTweetRequestVariablesMediaMediaEntitiesInner.js +54 -0
- package/dist/models/PostCreateTweetRequestVariablesMediaMediaEntitiesInner.js.map +1 -0
- package/dist/models/TimelineCommunity.d.ts +34 -0
- package/dist/models/TimelineCommunity.d.ts.map +1 -0
- package/dist/models/TimelineCommunity.js +59 -0
- package/dist/models/TimelineCommunity.js.map +1 -0
- package/dist/models/Tweet.d.ts +20 -0
- package/dist/models/Tweet.d.ts.map +1 -1
- package/dist/models/Tweet.js +8 -0
- package/dist/models/Tweet.js.map +1 -1
- package/dist/models/TypeName.d.ts +1 -0
- package/dist/models/TypeName.d.ts.map +1 -1
- package/dist/models/TypeName.js +1 -0
- package/dist/models/TypeName.js.map +1 -1
- package/dist/models/UserResults.d.ts +1 -1
- package/dist/models/UserResults.d.ts.map +1 -1
- package/dist/models/UserResults.js +2 -2
- package/dist/models/UserResults.js.map +1 -1
- package/dist/models/index.d.ts +18 -0
- package/dist/models/index.d.ts.map +1 -1
- package/dist/models/index.js +18 -0
- package/dist/models/index.js.map +1 -1
- package/package.json +2 -3
- package/src/apis/DefaultApi.ts +94 -6
- package/src/apis/OtherApi.ts +47 -3
- package/src/apis/PostApi.ts +282 -18
- package/src/apis/TweetApi.ts +526 -51
- package/src/apis/UserApi.ts +103 -6
- package/src/apis/UserListApi.ts +235 -24
- package/src/apis/UsersApi.ts +47 -3
- package/src/apis/V11GetApi.ts +94 -6
- package/src/apis/V11PostApi.ts +94 -6
- package/src/apis/V20GetApi.ts +47 -3
- package/src/models/BirdwatchEntity.ts +91 -0
- package/src/models/BirdwatchEntityRef.ts +102 -0
- package/src/models/BirdwatchPivot.ts +165 -0
- package/src/models/BirdwatchPivotFooter.ts +82 -0
- package/src/models/BirdwatchPivotNote.ts +66 -0
- package/src/models/BirdwatchPivotSubtitle.ts +82 -0
- package/src/models/ContentItemType.ts +2 -1
- package/src/models/CoverCta.ts +2 -3
- package/src/models/DeleteRetweet.ts +73 -0
- package/src/models/DeleteRetweetResponseResult.ts +72 -0
- package/src/models/ErrorResponse.ts +73 -0
- package/src/models/ExtMediaAvailability.ts +10 -1
- package/src/models/Extensions.ts +109 -0
- package/src/models/ItemContentUnion.ts +12 -1
- package/src/models/ListTweetsTimeline.ts +2 -3
- package/src/models/MediaExtended.ts +2 -3
- package/src/models/NoteTweet.ts +82 -0
- package/src/models/NoteTweetResult.ts +73 -0
- package/src/models/NoteTweetResultData.ts +119 -0
- package/src/models/NoteTweetResultMedia.ts +66 -0
- package/src/models/NoteTweetResultRichText.ts +73 -0
- package/src/models/NoteTweetResultRichTextTag.ts +95 -0
- package/src/models/PostCreateTweetRequestFeatures.ts +18 -27
- package/src/models/PostCreateTweetRequestVariablesMedia.ts +11 -4
- package/src/models/PostCreateTweetRequestVariablesMediaMediaEntitiesInner.ts +75 -0
- package/src/models/TimelineCommunity.ts +75 -0
- package/src/models/Tweet.ts +36 -0
- package/src/models/TypeName.ts +1 -0
- package/src/models/UserResults.ts +2 -3
- package/src/models/index.ts +18 -0
- package/tools/openapi-generator-config.yaml +1 -1
- package/twitter-openapi/.vscode/launch.json +8 -0
- package/twitter-openapi/README.md +2 -0
- package/twitter-openapi/dist/compatible/openapi-3.0.yaml +5189 -34
- package/twitter-openapi/dist/docs/openapi-3.0.yaml +6987 -34
- package/twitter-openapi/src/config/component/security_schemes.yaml +148 -0
- package/twitter-openapi/src/config/placeholder.json +145 -112
- package/twitter-openapi/src/openapi/paths/timeline.yaml +0 -2
- package/twitter-openapi/src/openapi/schemas/content.yaml +9 -1
- package/twitter-openapi/src/openapi/schemas/general.yaml +2 -2
- package/twitter-openapi/src/openapi/schemas/instruction.yaml +0 -1
- package/twitter-openapi/src/openapi/schemas/tweet.yaml +169 -2
- package/twitter-openapi/src/openapi/schemas/typename.yaml +1 -0
- package/twitter-openapi/src/openapi/schemas/user.yaml +0 -2
- package/twitter-openapi/test/python/test_serialize.py +24 -0
- package/twitter-openapi/tools/__pycache__/build_config.cpython-310.pyc +0 -0
- package/twitter-openapi/tools/__pycache__/hooks.cpython-310.pyc +0 -0
- package/twitter-openapi/tools/build.py +35 -31
- package/twitter-openapi/tools/build_config.py +7 -10
- package/twitter-openapi/dist/compatible/paths/bookmarks.yaml +0 -107
- package/twitter-openapi/dist/compatible/paths/follow.yaml +0 -301
- package/twitter-openapi/dist/compatible/paths/other.yaml +0 -99
- package/twitter-openapi/dist/compatible/paths/post.yaml +0 -714
- package/twitter-openapi/dist/compatible/paths/profile.yaml +0 -126
- package/twitter-openapi/dist/compatible/paths/timeline.yaml +0 -416
- package/twitter-openapi/dist/compatible/paths/tweet.yaml +0 -397
- package/twitter-openapi/dist/compatible/paths/user.yaml +0 -233
- package/twitter-openapi/dist/compatible/paths/usertweets.yaml +0 -504
- package/twitter-openapi/dist/compatible/paths/v1.1-get.yaml +0 -242
- package/twitter-openapi/dist/compatible/paths/v1.1-post.yaml +0 -237
- package/twitter-openapi/dist/compatible/paths/v2.0-get.yaml +0 -302
- package/twitter-openapi/dist/compatible/resources/parameters.yaml +0 -13
- package/twitter-openapi/dist/compatible/response/error.yaml +0 -90
- package/twitter-openapi/dist/compatible/schemas/content.yaml +0 -214
- package/twitter-openapi/dist/compatible/schemas/error.yaml +0 -94
- package/twitter-openapi/dist/compatible/schemas/general.yaml +0 -13
- package/twitter-openapi/dist/compatible/schemas/instruction.yaml +0 -286
- package/twitter-openapi/dist/compatible/schemas/timeline.yaml +0 -27
- package/twitter-openapi/dist/compatible/schemas/tweet.yaml +0 -508
- package/twitter-openapi/dist/compatible/schemas/typename.yaml +0 -23
- package/twitter-openapi/dist/compatible/schemas/user.yaml +0 -222
- package/twitter-openapi/dist/docs/paths/bookmarks.yaml +0 -201
- package/twitter-openapi/dist/docs/paths/follow.yaml +0 -587
- package/twitter-openapi/dist/docs/paths/other.yaml +0 -99
- package/twitter-openapi/dist/docs/paths/post.yaml +0 -692
- package/twitter-openapi/dist/docs/paths/profile.yaml +0 -134
- package/twitter-openapi/dist/docs/paths/timeline.yaml +0 -811
- package/twitter-openapi/dist/docs/paths/tweet.yaml +0 -797
- package/twitter-openapi/dist/docs/paths/user.yaml +0 -338
- package/twitter-openapi/dist/docs/paths/usertweets.yaml +0 -1046
- package/twitter-openapi/dist/docs/paths/v1.1-get.yaml +0 -242
- package/twitter-openapi/dist/docs/paths/v1.1-post.yaml +0 -237
- package/twitter-openapi/dist/docs/paths/v2.0-get.yaml +0 -302
- package/twitter-openapi/dist/docs/resources/parameters.yaml +0 -13
- package/twitter-openapi/dist/docs/response/error.yaml +0 -90
- package/twitter-openapi/dist/docs/schemas/content.yaml +0 -214
- package/twitter-openapi/dist/docs/schemas/error.yaml +0 -94
- package/twitter-openapi/dist/docs/schemas/general.yaml +0 -13
- package/twitter-openapi/dist/docs/schemas/instruction.yaml +0 -286
- package/twitter-openapi/dist/docs/schemas/timeline.yaml +0 -27
- package/twitter-openapi/dist/docs/schemas/tweet.yaml +0 -508
- package/twitter-openapi/dist/docs/schemas/typename.yaml +0 -23
- package/twitter-openapi/dist/docs/schemas/user.yaml +0 -222
|
@@ -125,6 +125,7 @@ components:
|
|
|
125
125
|
- $ref: "#/components/schemas/TimelineUser"
|
|
126
126
|
- $ref: "#/components/schemas/TimelinePrompt"
|
|
127
127
|
- $ref: "#/components/schemas/TimelineMessagePrompt"
|
|
128
|
+
- $ref: "#/components/schemas/TimelineCommunity"
|
|
128
129
|
|
|
129
130
|
discriminator:
|
|
130
131
|
propertyName: __typename
|
|
@@ -134,6 +135,7 @@ components:
|
|
|
134
135
|
TimelineUser: "#/components/schemas/TimelineUser"
|
|
135
136
|
TimelinePrompt: "#/components/schemas/TimelinePrompt"
|
|
136
137
|
TimelineMessagePrompt: "#/components/schemas/TimelineMessagePrompt"
|
|
138
|
+
TimelineCommunity: "#/components/schemas/TimelineCommunity"
|
|
137
139
|
|
|
138
140
|
ContentItemType:
|
|
139
141
|
type: string
|
|
@@ -144,6 +146,7 @@ components:
|
|
|
144
146
|
TimelineUser,
|
|
145
147
|
TimelinePrompt,
|
|
146
148
|
TimelineMessagePrompt,
|
|
149
|
+
TimelineCommunity,
|
|
147
150
|
]
|
|
148
151
|
|
|
149
152
|
TimelineTweet:
|
|
@@ -188,7 +191,6 @@ components:
|
|
|
188
191
|
$ref: "./user.yaml#/components/schemas/UserResults"
|
|
189
192
|
|
|
190
193
|
ItemResult:
|
|
191
|
-
required:
|
|
192
194
|
properties:
|
|
193
195
|
__typename:
|
|
194
196
|
$ref: "./typename.yaml#/components/schemas/TypeName" # null | TimelineTweet
|
|
@@ -217,6 +219,12 @@ components:
|
|
|
217
219
|
$ref: "./typename.yaml#/components/schemas/TypeName" # TimelineMessagePrompt
|
|
218
220
|
additionalProperties: true # todo
|
|
219
221
|
|
|
222
|
+
TimelineCommunity:
|
|
223
|
+
properties:
|
|
224
|
+
__typename:
|
|
225
|
+
$ref: "./typename.yaml#/components/schemas/TypeName" # TimelineCommunity
|
|
226
|
+
additionalProperties: true # todo
|
|
227
|
+
|
|
220
228
|
ClientEventInfo:
|
|
221
229
|
properties:
|
|
222
230
|
component:
|
|
@@ -8,5 +8,5 @@ components:
|
|
|
8
8
|
schemas:
|
|
9
9
|
TwitterTimeFormat:
|
|
10
10
|
type: string
|
|
11
|
-
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})$"
|
|
12
|
-
example: "Sat Dec 31 23:59:59 +0000 2023"
|
|
11
|
+
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})$"
|
|
12
|
+
example: "Sat Dec 31 23:59:59 +0000 2023" # Wed Sep 20 02: 55: 44 +0000 2023
|
|
@@ -52,6 +52,8 @@ components:
|
|
|
52
52
|
rest_id:
|
|
53
53
|
type: string
|
|
54
54
|
pattern: "^[0-9]+$"
|
|
55
|
+
birdwatch_pivot:
|
|
56
|
+
$ref: "#/components/schemas/BirdwatchPivot"
|
|
55
57
|
core:
|
|
56
58
|
$ref: "./user.yaml#/components/schemas/UserResultCore"
|
|
57
59
|
card:
|
|
@@ -74,6 +76,10 @@ components:
|
|
|
74
76
|
$ref: "#/components/schemas/TweetView"
|
|
75
77
|
quoted_status_result:
|
|
76
78
|
$ref: "./content.yaml#/components/schemas/ItemResult"
|
|
79
|
+
note_tweet:
|
|
80
|
+
$ref: "#/components/schemas/NoteTweet"
|
|
81
|
+
quick_promote_eligibility:
|
|
82
|
+
type: object
|
|
77
83
|
|
|
78
84
|
TweetEditControl:
|
|
79
85
|
properties:
|
|
@@ -134,6 +140,165 @@ components:
|
|
|
134
140
|
type: string
|
|
135
141
|
enum: [EnabledWithCount]
|
|
136
142
|
|
|
143
|
+
NoteTweet:
|
|
144
|
+
required:
|
|
145
|
+
- "is_expandable"
|
|
146
|
+
- "note_tweet_results"
|
|
147
|
+
properties:
|
|
148
|
+
is_expandable:
|
|
149
|
+
type: boolean
|
|
150
|
+
note_tweet_results:
|
|
151
|
+
$ref: "#/components/schemas/NoteTweetResult"
|
|
152
|
+
|
|
153
|
+
NoteTweetResult:
|
|
154
|
+
required:
|
|
155
|
+
- "result"
|
|
156
|
+
properties:
|
|
157
|
+
result:
|
|
158
|
+
$ref: "#/components/schemas/NoteTweetResultData"
|
|
159
|
+
|
|
160
|
+
NoteTweetResultData:
|
|
161
|
+
required:
|
|
162
|
+
- "entity_set"
|
|
163
|
+
- "id"
|
|
164
|
+
- "text"
|
|
165
|
+
properties:
|
|
166
|
+
entity_set:
|
|
167
|
+
$ref: "#/components/schemas/Entities"
|
|
168
|
+
id:
|
|
169
|
+
type: string
|
|
170
|
+
pattern: "^([A-Za-z0-9+/]{4})*([A-Za-z0-9+/]{3}=|[A-Za-z0-9+/]{2}==)?$" # base64
|
|
171
|
+
media:
|
|
172
|
+
$ref: "#/components/schemas/NoteTweetResultMedia"
|
|
173
|
+
richtext:
|
|
174
|
+
$ref: "#/components/schemas/NoteTweetResultRichText"
|
|
175
|
+
text:
|
|
176
|
+
type: string
|
|
177
|
+
|
|
178
|
+
NoteTweetResultMedia:
|
|
179
|
+
required:
|
|
180
|
+
- "inline_media"
|
|
181
|
+
properties:
|
|
182
|
+
inline_media:
|
|
183
|
+
type: array
|
|
184
|
+
items:
|
|
185
|
+
type: object
|
|
186
|
+
NoteTweetResultRichText:
|
|
187
|
+
required:
|
|
188
|
+
- "richtext_tags"
|
|
189
|
+
properties:
|
|
190
|
+
richtext_tags:
|
|
191
|
+
type: array
|
|
192
|
+
items:
|
|
193
|
+
$ref: "#/components/schemas/NoteTweetResultRichTextTag"
|
|
194
|
+
|
|
195
|
+
NoteTweetResultRichTextTag:
|
|
196
|
+
required:
|
|
197
|
+
- "from_index"
|
|
198
|
+
- "to_index"
|
|
199
|
+
- "richtext_types"
|
|
200
|
+
properties:
|
|
201
|
+
from_index:
|
|
202
|
+
type: integer
|
|
203
|
+
to_index:
|
|
204
|
+
type: integer
|
|
205
|
+
richtext_types:
|
|
206
|
+
type: array
|
|
207
|
+
items:
|
|
208
|
+
type: string
|
|
209
|
+
enum: [Bold, Italic]
|
|
210
|
+
|
|
211
|
+
BirdwatchPivot:
|
|
212
|
+
required:
|
|
213
|
+
- "destinationUrl"
|
|
214
|
+
- "footer"
|
|
215
|
+
- "note"
|
|
216
|
+
- "subtitle"
|
|
217
|
+
- "title"
|
|
218
|
+
- "shorttitle"
|
|
219
|
+
- "iconType"
|
|
220
|
+
properties:
|
|
221
|
+
destinationUrl:
|
|
222
|
+
type: string
|
|
223
|
+
format: uri
|
|
224
|
+
footer:
|
|
225
|
+
$ref: "#/components/schemas/BirdwatchPivotFooter"
|
|
226
|
+
note:
|
|
227
|
+
$ref: "#/components/schemas/BirdwatchPivotNote"
|
|
228
|
+
subtitle:
|
|
229
|
+
$ref: "#/components/schemas/BirdwatchPivotSubtitle"
|
|
230
|
+
title:
|
|
231
|
+
type: string
|
|
232
|
+
shorttitle:
|
|
233
|
+
type: string
|
|
234
|
+
visualStyle:
|
|
235
|
+
type: string
|
|
236
|
+
enum: [Default]
|
|
237
|
+
iconType:
|
|
238
|
+
type: string
|
|
239
|
+
enum: [BirdwatchV1Icon]
|
|
240
|
+
|
|
241
|
+
BirdwatchPivotFooter:
|
|
242
|
+
required:
|
|
243
|
+
- "text"
|
|
244
|
+
- "entities"
|
|
245
|
+
properties:
|
|
246
|
+
text:
|
|
247
|
+
type: string
|
|
248
|
+
entities:
|
|
249
|
+
type: array
|
|
250
|
+
items:
|
|
251
|
+
$ref: "#/components/schemas/BirdwatchEntity"
|
|
252
|
+
|
|
253
|
+
BirdwatchEntity:
|
|
254
|
+
required:
|
|
255
|
+
- "fromIndex"
|
|
256
|
+
- "toIndex"
|
|
257
|
+
- "ref"
|
|
258
|
+
properties:
|
|
259
|
+
fromIndex:
|
|
260
|
+
type: integer
|
|
261
|
+
toIndex:
|
|
262
|
+
type: integer
|
|
263
|
+
ref:
|
|
264
|
+
$ref: "#/components/schemas/BirdwatchEntityRef"
|
|
265
|
+
|
|
266
|
+
BirdwatchEntityRef:
|
|
267
|
+
required:
|
|
268
|
+
- "type"
|
|
269
|
+
- "url"
|
|
270
|
+
- "urlType"
|
|
271
|
+
properties:
|
|
272
|
+
type:
|
|
273
|
+
type: string
|
|
274
|
+
enum: [TimelineUrl]
|
|
275
|
+
url:
|
|
276
|
+
type: string
|
|
277
|
+
format: uri
|
|
278
|
+
urlType:
|
|
279
|
+
type: string
|
|
280
|
+
enum: [ExternalUrl]
|
|
281
|
+
|
|
282
|
+
BirdwatchPivotNote:
|
|
283
|
+
required:
|
|
284
|
+
- "rest_id"
|
|
285
|
+
properties:
|
|
286
|
+
rest_id:
|
|
287
|
+
type: string
|
|
288
|
+
pattern: "^[0-9]+$"
|
|
289
|
+
|
|
290
|
+
BirdwatchPivotSubtitle:
|
|
291
|
+
required:
|
|
292
|
+
- "text"
|
|
293
|
+
- "entities"
|
|
294
|
+
properties:
|
|
295
|
+
text:
|
|
296
|
+
type: string
|
|
297
|
+
entities:
|
|
298
|
+
type: array
|
|
299
|
+
items:
|
|
300
|
+
$ref: "#/components/schemas/BirdwatchEntity"
|
|
301
|
+
|
|
137
302
|
TweetCard:
|
|
138
303
|
properties:
|
|
139
304
|
rest_id:
|
|
@@ -378,7 +543,7 @@ components:
|
|
|
378
543
|
- "media_url_https"
|
|
379
544
|
- "type"
|
|
380
545
|
- "url"
|
|
381
|
-
- "ext_media_availability"
|
|
546
|
+
# - "ext_media_availability"
|
|
382
547
|
# - "features"
|
|
383
548
|
- "sizes"
|
|
384
549
|
- "original_info"
|
|
@@ -500,9 +665,11 @@ components:
|
|
|
500
665
|
# required:
|
|
501
666
|
# - "status"
|
|
502
667
|
properties:
|
|
668
|
+
reason:
|
|
669
|
+
type: string # enum Dmcaed
|
|
503
670
|
status:
|
|
504
671
|
type: string
|
|
505
|
-
enum: [Available]
|
|
672
|
+
enum: [Available, Unavailable]
|
|
506
673
|
|
|
507
674
|
MediaSizes:
|
|
508
675
|
required:
|
|
@@ -256,5 +256,29 @@ if __name__ == "__main__":
|
|
|
256
256
|
error_dump(e)
|
|
257
257
|
error_count += 1
|
|
258
258
|
|
|
259
|
+
try:
|
|
260
|
+
logger.info(f"Try: Self TweetDetail Test")
|
|
261
|
+
kwargs = get_kwargs("TweetDetail", {"focalTweetId": "1720975693524377759"})
|
|
262
|
+
res = pt.TweetApi(api_client).get_tweet_detail_with_http_info(**kwargs)
|
|
263
|
+
data = res.data.to_dict()
|
|
264
|
+
|
|
265
|
+
rate = match_rate(data, json.loads(res.raw_data))
|
|
266
|
+
logger.info(f"Match rate: {rate}")
|
|
267
|
+
except Exception as e:
|
|
268
|
+
error_dump(e)
|
|
269
|
+
error_count += 1
|
|
270
|
+
|
|
271
|
+
try:
|
|
272
|
+
logger.info(f"Try: Self TweetDetail Test")
|
|
273
|
+
kwargs = get_kwargs("TweetDetail", {"focalTweetId": "1720818185186791678"})
|
|
274
|
+
res = pt.TweetApi(api_client).get_tweet_detail_with_http_info(**kwargs)
|
|
275
|
+
data = res.data.to_dict()
|
|
276
|
+
|
|
277
|
+
rate = match_rate(data, json.loads(res.raw_data))
|
|
278
|
+
logger.info(f"Match rate: {rate}")
|
|
279
|
+
except Exception as e:
|
|
280
|
+
error_dump(e)
|
|
281
|
+
error_count += 1
|
|
282
|
+
|
|
259
283
|
if error_count > 0:
|
|
260
284
|
exit(1)
|
|
Binary file
|
|
Binary file
|
|
@@ -1,79 +1,83 @@
|
|
|
1
1
|
import os
|
|
2
2
|
import glob
|
|
3
|
-
import json
|
|
4
3
|
import yaml
|
|
5
4
|
import shutil
|
|
6
|
-
import copy
|
|
7
|
-
import re
|
|
8
5
|
from build_config import Config
|
|
9
|
-
from hooks import OpenapiHookBase, RequestHookBase, SchemasHookBase,OtherHookBase
|
|
6
|
+
from hooks import OpenapiHookBase, RequestHookBase, SchemasHookBase, OtherHookBase
|
|
10
7
|
from tqdm import tqdm
|
|
11
8
|
|
|
12
9
|
|
|
10
|
+
def replace_ref(x):
|
|
11
|
+
if isinstance(x, dict):
|
|
12
|
+
return {
|
|
13
|
+
key: "#" + value.split("#")[-1] if key == "$ref" else replace_ref(value)
|
|
14
|
+
for key, value in x.items()
|
|
15
|
+
}
|
|
16
|
+
elif isinstance(x, list):
|
|
17
|
+
return [replace_ref(value) for value in x]
|
|
18
|
+
return x
|
|
19
|
+
|
|
20
|
+
|
|
13
21
|
print("=== Build Start ===")
|
|
14
22
|
|
|
15
23
|
|
|
16
24
|
config = Config()
|
|
17
25
|
|
|
18
26
|
|
|
19
|
-
|
|
20
|
-
shutil.rmtree("dist")
|
|
21
|
-
except:
|
|
22
|
-
pass
|
|
23
|
-
|
|
24
|
-
for lang, profile in tqdm(config.main().items(), leave=False):
|
|
25
|
-
dist_replace = lambda x: x.replace(
|
|
26
|
-
config.INPUT_DIR, config.OUTPUT_DIR.format(lang), 1
|
|
27
|
-
)
|
|
27
|
+
shutil.rmtree("dist", ignore_errors=True)
|
|
28
28
|
|
|
29
|
-
for dir in glob.glob(os.path.join(config.INPUT_DIR, "**/")):
|
|
30
|
-
os.makedirs(dist_replace(dir), exist_ok=True)
|
|
31
29
|
|
|
30
|
+
for lang, profile in tqdm(config.main().items(), leave=False):
|
|
32
31
|
paths = {}
|
|
32
|
+
schemas = {}
|
|
33
33
|
files = glob.glob(os.path.join(config.INPUT_DIR, "**/*.yaml"))
|
|
34
34
|
for file in tqdm(files, leave=False):
|
|
35
35
|
file = file.replace(os.path.sep, "/")
|
|
36
36
|
with open(file, mode="r", encoding="utf-8") as f:
|
|
37
37
|
load = yaml.safe_load(f)
|
|
38
|
+
|
|
39
|
+
# RequestHookBase hook
|
|
38
40
|
for path in list(load["paths"]):
|
|
39
41
|
for method in list(load["paths"][path]):
|
|
42
|
+
key, value = path, load["paths"][path][method]
|
|
40
43
|
for tag in list(load["paths"][path][method].get("tags", ["default"])):
|
|
41
|
-
key, value = path, load["paths"][path][method]
|
|
42
44
|
for hook in profile["request"][tag]:
|
|
43
45
|
hook: RequestHookBase
|
|
44
46
|
key, value = hook.hook(key, value)
|
|
45
|
-
|
|
46
|
-
|
|
47
|
+
paths.update({key: {}})
|
|
48
|
+
paths[key].update({method: value})
|
|
47
49
|
|
|
48
|
-
|
|
49
|
-
relative = file.replace(config.INPUT_DIR, "", 1)
|
|
50
|
-
paths.update({key: {"$ref": f".{relative}#/paths/{escape}"}})
|
|
50
|
+
# SchemasHookBase hook
|
|
51
51
|
for name in list(load.get("components", {}).get("schemas", {})):
|
|
52
52
|
value = load["components"]["schemas"][name]
|
|
53
53
|
for hook in profile["schemas"]:
|
|
54
54
|
hook: SchemasHookBase
|
|
55
55
|
value = hook.hook(value)
|
|
56
|
-
|
|
56
|
+
schemas.update({name: value})
|
|
57
|
+
|
|
58
|
+
# OtherHookBase hook
|
|
57
59
|
if file == "src/openapi/paths/other.yaml":
|
|
58
60
|
for hook in profile["other"]:
|
|
59
61
|
hook: OtherHookBase
|
|
60
62
|
key, value = hook.hook()
|
|
61
|
-
|
|
62
|
-
load["components"]["schemas"]["OtherResponse"]["properties"][key] = {
|
|
63
|
-
"$ref": f"#/components/schemas/{key}"
|
|
64
|
-
}
|
|
65
|
-
with open(dist_replace(file), mode="w+", encoding="utf-8") as f:
|
|
66
|
-
f.write(yaml.dump(load))
|
|
63
|
+
schemas["OtherResponse"]["properties"].append({key: value})
|
|
67
64
|
|
|
68
65
|
file = "src/openapi/openapi-3.0.yaml"
|
|
66
|
+
|
|
69
67
|
with open(file, mode="r", encoding="utf-8") as f:
|
|
70
68
|
openapi = yaml.safe_load(f)
|
|
71
|
-
|
|
72
|
-
|
|
69
|
+
|
|
70
|
+
# OpenapiHookBase hook
|
|
73
71
|
for hook in profile["openapi"]:
|
|
74
72
|
hook: OpenapiHookBase
|
|
75
73
|
openapi = hook.hook(openapi)
|
|
76
|
-
|
|
74
|
+
|
|
75
|
+
openapi["paths"] = replace_ref(paths)
|
|
76
|
+
openapi["components"]["schemas"] = replace_ref(schemas)
|
|
77
|
+
output = config.OUTPUT_DIR.format(lang)
|
|
78
|
+
os.makedirs(output, exist_ok=True)
|
|
79
|
+
|
|
80
|
+
with open(output + "/openapi-3.0.yaml", mode="w+", encoding="utf-8") as f:
|
|
77
81
|
f.write(yaml.dump(openapi))
|
|
78
82
|
|
|
79
83
|
print("=== Build End ===")
|
|
@@ -8,26 +8,19 @@ class Config:
|
|
|
8
8
|
def hooks_generator(self, queryParameterJson=True):
|
|
9
9
|
# https://stackoverflow.com/questions/34820064/defining-an-api-with-swagger-get-call-that-uses-json-in-parameters/45223964
|
|
10
10
|
if queryParameterJson:
|
|
11
|
+
# ["parameters"][0]["content"]["application/json"]["schema"]
|
|
11
12
|
getParamHook = AddParametersOnContent(
|
|
12
13
|
split=-1,
|
|
13
14
|
contentType="application/json",
|
|
14
15
|
ignoreKeys=["queryId"],
|
|
15
16
|
)
|
|
16
|
-
postParamHook = AddParametersOnParameters(
|
|
17
|
-
split=-1,
|
|
18
|
-
schemaType=None,
|
|
19
|
-
)
|
|
20
17
|
else:
|
|
18
|
+
# ["parameters"][0]["schema"]
|
|
21
19
|
getParamHook = AddParametersOnParameters(
|
|
22
20
|
split=-1,
|
|
23
21
|
schemaType="string",
|
|
24
22
|
ignoreKeys=["queryId"],
|
|
25
23
|
)
|
|
26
|
-
postParamHook = AddParametersOnBody(
|
|
27
|
-
split=-1,
|
|
28
|
-
schemaType=None,
|
|
29
|
-
contentType="application/json",
|
|
30
|
-
)
|
|
31
24
|
|
|
32
25
|
return {
|
|
33
26
|
"openapi": [AddSecuritySchemesOnSecuritySchemes()],
|
|
@@ -45,7 +38,11 @@ class Config:
|
|
|
45
38
|
key: [
|
|
46
39
|
SetResponsesHeader(suffix=None),
|
|
47
40
|
AddPathQueryIdOnParameters(split=-1),
|
|
48
|
-
|
|
41
|
+
AddParametersOnBody(
|
|
42
|
+
split=-1,
|
|
43
|
+
schemaType=None,
|
|
44
|
+
contentType="application/json",
|
|
45
|
+
),
|
|
49
46
|
]
|
|
50
47
|
for key in ["post"]
|
|
51
48
|
}
|
|
@@ -1,107 +0,0 @@
|
|
|
1
|
-
components:
|
|
2
|
-
schemas:
|
|
3
|
-
BookmarksResponse:
|
|
4
|
-
properties:
|
|
5
|
-
data:
|
|
6
|
-
$ref: '#/components/schemas/BookmarksResponseData'
|
|
7
|
-
required:
|
|
8
|
-
- data
|
|
9
|
-
BookmarksResponseData:
|
|
10
|
-
properties:
|
|
11
|
-
bookmark_timeline_v2:
|
|
12
|
-
$ref: '#/components/schemas/BookmarksTimeline'
|
|
13
|
-
required:
|
|
14
|
-
- bookmark_timeline_v2
|
|
15
|
-
BookmarksTimeline:
|
|
16
|
-
properties:
|
|
17
|
-
timeline:
|
|
18
|
-
$ref: ./../schemas/timeline.yaml#/components/schemas/Timeline
|
|
19
|
-
required:
|
|
20
|
-
- timeline
|
|
21
|
-
info:
|
|
22
|
-
title: Twitter OpenAPI
|
|
23
|
-
version: 0.0.1
|
|
24
|
-
openapi: 3.0.3
|
|
25
|
-
paths:
|
|
26
|
-
/graphql/{pathQueryId}/Bookmarks:
|
|
27
|
-
get:
|
|
28
|
-
description: get bookmarks
|
|
29
|
-
operationId: getBookmarks
|
|
30
|
-
parameters:
|
|
31
|
-
- in: path
|
|
32
|
-
name: pathQueryId
|
|
33
|
-
required: true
|
|
34
|
-
schema:
|
|
35
|
-
default: tmd4ifV8RHltzn8ymGg1aw
|
|
36
|
-
example: tmd4ifV8RHltzn8ymGg1aw
|
|
37
|
-
type: string
|
|
38
|
-
- in: query
|
|
39
|
-
name: variables
|
|
40
|
-
required: true
|
|
41
|
-
schema:
|
|
42
|
-
default: '{"count": 20, "includePromotedContent": true}'
|
|
43
|
-
example: '{"count": 20, "includePromotedContent": true}'
|
|
44
|
-
type: string
|
|
45
|
-
- in: query
|
|
46
|
-
name: features
|
|
47
|
-
required: true
|
|
48
|
-
schema:
|
|
49
|
-
default: '{"graphql_timeline_v2_bookmark_timeline": true, "blue_business_profile_image_shape_enabled":
|
|
50
|
-
true, "responsive_web_graphql_exclude_directive_enabled": true, "verified_phone_label_enabled":
|
|
51
|
-
false, "responsive_web_graphql_timeline_navigation_enabled": true, "responsive_web_graphql_skip_user_profile_image_extensions_enabled":
|
|
52
|
-
false, "tweetypie_unmention_optimization_enabled": true, "vibe_api_enabled":
|
|
53
|
-
true, "responsive_web_edit_tweet_api_enabled": true, "graphql_is_translatable_rweb_tweet_is_translatable_enabled":
|
|
54
|
-
true, "view_counts_everywhere_api_enabled": true, "longform_notetweets_consumption_enabled":
|
|
55
|
-
true, "tweet_awards_web_tipping_enabled": false, "freedom_of_speech_not_reach_fetch_enabled":
|
|
56
|
-
false, "standardized_nudges_misinfo": true, "tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled":
|
|
57
|
-
false, "interactive_text_enabled": true, "responsive_web_text_conversations_enabled":
|
|
58
|
-
false, "longform_notetweets_rich_text_read_enabled": true, "responsive_web_enhance_cards_enabled":
|
|
59
|
-
false}'
|
|
60
|
-
example: '{"graphql_timeline_v2_bookmark_timeline": true, "blue_business_profile_image_shape_enabled":
|
|
61
|
-
true, "responsive_web_graphql_exclude_directive_enabled": true, "verified_phone_label_enabled":
|
|
62
|
-
false, "responsive_web_graphql_timeline_navigation_enabled": true, "responsive_web_graphql_skip_user_profile_image_extensions_enabled":
|
|
63
|
-
false, "tweetypie_unmention_optimization_enabled": true, "vibe_api_enabled":
|
|
64
|
-
true, "responsive_web_edit_tweet_api_enabled": true, "graphql_is_translatable_rweb_tweet_is_translatable_enabled":
|
|
65
|
-
true, "view_counts_everywhere_api_enabled": true, "longform_notetweets_consumption_enabled":
|
|
66
|
-
true, "tweet_awards_web_tipping_enabled": false, "freedom_of_speech_not_reach_fetch_enabled":
|
|
67
|
-
false, "standardized_nudges_misinfo": true, "tweet_with_visibility_results_prefer_gql_limited_actions_policy_enabled":
|
|
68
|
-
false, "interactive_text_enabled": true, "responsive_web_text_conversations_enabled":
|
|
69
|
-
false, "longform_notetweets_rich_text_read_enabled": true, "responsive_web_enhance_cards_enabled":
|
|
70
|
-
false}'
|
|
71
|
-
type: string
|
|
72
|
-
responses:
|
|
73
|
-
'200':
|
|
74
|
-
content:
|
|
75
|
-
application/json:
|
|
76
|
-
schema:
|
|
77
|
-
oneOf:
|
|
78
|
-
- $ref: '#/components/schemas/BookmarksResponse'
|
|
79
|
-
- $ref: ./../schemas/error.yaml#/components/schemas/Errors
|
|
80
|
-
description: Successful operation
|
|
81
|
-
headers:
|
|
82
|
-
x-connection-hash:
|
|
83
|
-
schema:
|
|
84
|
-
type: string
|
|
85
|
-
x-rate-limit-limit:
|
|
86
|
-
schema:
|
|
87
|
-
type: integer
|
|
88
|
-
x-rate-limit-remaining:
|
|
89
|
-
schema:
|
|
90
|
-
type: integer
|
|
91
|
-
x-rate-limit-reset:
|
|
92
|
-
schema:
|
|
93
|
-
type: integer
|
|
94
|
-
x-response-time:
|
|
95
|
-
schema:
|
|
96
|
-
type: integer
|
|
97
|
-
x-tfe-preserve-body:
|
|
98
|
-
schema:
|
|
99
|
-
type: boolean
|
|
100
|
-
x-transaction-id:
|
|
101
|
-
schema:
|
|
102
|
-
type: string
|
|
103
|
-
x-twitter-response-tags:
|
|
104
|
-
schema:
|
|
105
|
-
type: string
|
|
106
|
-
tags:
|
|
107
|
-
- tweet
|