twitter-openapi-typescript-generated 0.0.12 → 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.
Files changed (108) hide show
  1. package/.openapi-generator/FILES +13 -0
  2. package/README.md +2 -2
  3. package/dist/models/BirdwatchEntity.d.ts +45 -0
  4. package/dist/models/BirdwatchEntity.d.ts.map +1 -0
  5. package/dist/models/BirdwatchEntity.js +58 -0
  6. package/dist/models/BirdwatchEntity.js.map +1 -0
  7. package/dist/models/BirdwatchEntityRef.d.ts +58 -0
  8. package/dist/models/BirdwatchEntityRef.d.ts.map +1 -0
  9. package/dist/models/BirdwatchEntityRef.js +69 -0
  10. package/dist/models/BirdwatchEntityRef.js.map +1 -0
  11. package/dist/models/BirdwatchPivot.d.ts +91 -0
  12. package/dist/models/BirdwatchPivot.d.ts.map +1 -0
  13. package/dist/models/BirdwatchPivot.js +87 -0
  14. package/dist/models/BirdwatchPivot.js.map +1 -0
  15. package/dist/models/BirdwatchPivotFooter.d.ts +39 -0
  16. package/dist/models/BirdwatchPivotFooter.d.ts.map +1 -0
  17. package/dist/models/BirdwatchPivotFooter.js +55 -0
  18. package/dist/models/BirdwatchPivotFooter.js.map +1 -0
  19. package/dist/models/BirdwatchPivotNote.d.ts +32 -0
  20. package/dist/models/BirdwatchPivotNote.d.ts.map +1 -0
  21. package/dist/models/BirdwatchPivotNote.js +51 -0
  22. package/dist/models/BirdwatchPivotNote.js.map +1 -0
  23. package/dist/models/BirdwatchPivotSubtitle.d.ts +39 -0
  24. package/dist/models/BirdwatchPivotSubtitle.d.ts.map +1 -0
  25. package/dist/models/BirdwatchPivotSubtitle.js +55 -0
  26. package/dist/models/BirdwatchPivotSubtitle.js.map +1 -0
  27. package/dist/models/ContentItemType.d.ts +1 -0
  28. package/dist/models/ContentItemType.d.ts.map +1 -1
  29. package/dist/models/ContentItemType.js +2 -1
  30. package/dist/models/ContentItemType.js.map +1 -1
  31. package/dist/models/ExtMediaAvailability.d.ts +7 -0
  32. package/dist/models/ExtMediaAvailability.d.ts.map +1 -1
  33. package/dist/models/ExtMediaAvailability.js +4 -1
  34. package/dist/models/ExtMediaAvailability.js.map +1 -1
  35. package/dist/models/ItemContentUnion.d.ts +3 -0
  36. package/dist/models/ItemContentUnion.d.ts.map +1 -1
  37. package/dist/models/ItemContentUnion.js +5 -0
  38. package/dist/models/ItemContentUnion.js.map +1 -1
  39. package/dist/models/NoteTweet.d.ts +39 -0
  40. package/dist/models/NoteTweet.d.ts.map +1 -0
  41. package/dist/models/NoteTweet.js +55 -0
  42. package/dist/models/NoteTweet.js.map +1 -0
  43. package/dist/models/NoteTweetResult.d.ts +33 -0
  44. package/dist/models/NoteTweetResult.d.ts.map +1 -0
  45. package/dist/models/NoteTweetResult.js +52 -0
  46. package/dist/models/NoteTweetResult.js.map +1 -0
  47. package/dist/models/NoteTweetResultData.d.ts +59 -0
  48. package/dist/models/NoteTweetResultData.d.ts.map +1 -0
  49. package/dist/models/NoteTweetResultData.js +65 -0
  50. package/dist/models/NoteTweetResultData.js.map +1 -0
  51. package/dist/models/NoteTweetResultMedia.d.ts +32 -0
  52. package/dist/models/NoteTweetResultMedia.d.ts.map +1 -0
  53. package/dist/models/NoteTweetResultMedia.js +51 -0
  54. package/dist/models/NoteTweetResultMedia.js.map +1 -0
  55. package/dist/models/NoteTweetResultRichText.d.ts +33 -0
  56. package/dist/models/NoteTweetResultRichText.d.ts.map +1 -0
  57. package/dist/models/NoteTweetResultRichText.js +52 -0
  58. package/dist/models/NoteTweetResultRichText.js.map +1 -0
  59. package/dist/models/NoteTweetResultRichTextTag.d.ts +52 -0
  60. package/dist/models/NoteTweetResultRichTextTag.d.ts.map +1 -0
  61. package/dist/models/NoteTweetResultRichTextTag.js +64 -0
  62. package/dist/models/NoteTweetResultRichTextTag.js.map +1 -0
  63. package/dist/models/TimelineCommunity.d.ts +34 -0
  64. package/dist/models/TimelineCommunity.d.ts.map +1 -0
  65. package/dist/models/TimelineCommunity.js +59 -0
  66. package/dist/models/TimelineCommunity.js.map +1 -0
  67. package/dist/models/Tweet.d.ts +20 -0
  68. package/dist/models/Tweet.d.ts.map +1 -1
  69. package/dist/models/Tweet.js +8 -0
  70. package/dist/models/Tweet.js.map +1 -1
  71. package/dist/models/TypeName.d.ts +1 -0
  72. package/dist/models/TypeName.d.ts.map +1 -1
  73. package/dist/models/TypeName.js +1 -0
  74. package/dist/models/TypeName.js.map +1 -1
  75. package/dist/models/index.d.ts +13 -0
  76. package/dist/models/index.d.ts.map +1 -1
  77. package/dist/models/index.js +13 -0
  78. package/dist/models/index.js.map +1 -1
  79. package/package.json +2 -3
  80. package/src/models/BirdwatchEntity.ts +91 -0
  81. package/src/models/BirdwatchEntityRef.ts +102 -0
  82. package/src/models/BirdwatchPivot.ts +165 -0
  83. package/src/models/BirdwatchPivotFooter.ts +82 -0
  84. package/src/models/BirdwatchPivotNote.ts +66 -0
  85. package/src/models/BirdwatchPivotSubtitle.ts +82 -0
  86. package/src/models/ContentItemType.ts +2 -1
  87. package/src/models/ExtMediaAvailability.ts +10 -1
  88. package/src/models/ItemContentUnion.ts +12 -1
  89. package/src/models/NoteTweet.ts +82 -0
  90. package/src/models/NoteTweetResult.ts +73 -0
  91. package/src/models/NoteTweetResultData.ts +119 -0
  92. package/src/models/NoteTweetResultMedia.ts +66 -0
  93. package/src/models/NoteTweetResultRichText.ts +73 -0
  94. package/src/models/NoteTweetResultRichTextTag.ts +95 -0
  95. package/src/models/TimelineCommunity.ts +75 -0
  96. package/src/models/Tweet.ts +36 -0
  97. package/src/models/TypeName.ts +1 -0
  98. package/src/models/index.ts +13 -0
  99. package/tools/openapi-generator-config.yaml +1 -1
  100. package/twitter-openapi/README.md +2 -0
  101. package/twitter-openapi/dist/compatible/openapi-3.0.yaml +172 -0
  102. package/twitter-openapi/dist/docs/openapi-3.0.yaml +172 -0
  103. package/twitter-openapi/src/openapi/schemas/content.yaml +9 -0
  104. package/twitter-openapi/src/openapi/schemas/tweet.yaml +168 -1
  105. package/twitter-openapi/src/openapi/schemas/typename.yaml +1 -0
  106. package/twitter-openapi/test/python/test_serialize.py +24 -0
  107. package/twitter-openapi/tools/__pycache__/build_config.cpython-310.pyc +0 -0
  108. package/twitter-openapi/tools/__pycache__/hooks.cpython-310.pyc +0 -0
@@ -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:
@@ -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:
@@ -18,6 +18,7 @@ components:
18
18
  TweetTombstone,
19
19
  TimelinePrompt,
20
20
  TimelineMessagePrompt,
21
+ TimelineCommunity,
21
22
  TweetUnavailable,
22
23
  Tweet,
23
24
  User,
@@ -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)