rettiwt-api 5.0.0-alpha.0 → 5.0.0-alpha.2

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 (465) hide show
  1. package/.eslintrc.js +2 -3
  2. package/.github/workflows/documentation.yml +1 -1
  3. package/.github/workflows/publish-alpha.yml +1 -1
  4. package/.github/workflows/publish.yml +1 -1
  5. package/.prettierignore +1 -1
  6. package/.tool-versions +1 -1
  7. package/README.md +100 -100
  8. package/dist/Rettiwt.d.ts +10 -3
  9. package/dist/Rettiwt.js +31 -12
  10. package/dist/Rettiwt.js.map +1 -1
  11. package/dist/cli.js +8 -11
  12. package/dist/cli.js.map +1 -1
  13. package/dist/collections/Extractors.d.ts +36 -2
  14. package/dist/collections/Extractors.js +41 -69
  15. package/dist/collections/Extractors.js.map +1 -1
  16. package/dist/collections/Groups.js +5 -1
  17. package/dist/collections/Groups.js.map +1 -1
  18. package/dist/collections/Requests.d.ts +3 -3
  19. package/dist/collections/Requests.js +41 -40
  20. package/dist/collections/Requests.js.map +1 -1
  21. package/dist/commands/List.js +21 -78
  22. package/dist/commands/List.js.map +1 -1
  23. package/dist/commands/Tweet.js +214 -373
  24. package/dist/commands/Tweet.js.map +1 -1
  25. package/dist/commands/User.js +138 -305
  26. package/dist/commands/User.js.map +1 -1
  27. package/dist/enums/Authentication.d.ts +10 -0
  28. package/dist/enums/Authentication.js +15 -0
  29. package/dist/enums/Authentication.js.map +1 -0
  30. package/dist/enums/Data.d.ts +3 -3
  31. package/dist/enums/Data.js +3 -3
  32. package/dist/enums/Media.d.ts +10 -0
  33. package/dist/enums/Media.js +15 -0
  34. package/dist/enums/Media.js.map +1 -0
  35. package/dist/enums/Notification.d.ts +12 -0
  36. package/dist/enums/Notification.js +17 -0
  37. package/dist/enums/Notification.js.map +1 -0
  38. package/dist/enums/Resource.d.ts +4 -0
  39. package/dist/enums/Resource.js +4 -0
  40. package/dist/enums/Resource.js.map +1 -1
  41. package/dist/enums/raw/Analytics.d.ts +28 -0
  42. package/dist/enums/raw/Analytics.js +34 -0
  43. package/dist/enums/raw/Analytics.js.map +1 -0
  44. package/dist/enums/raw/Media.d.ts +10 -0
  45. package/dist/enums/raw/Media.js +15 -0
  46. package/dist/enums/raw/Media.js.map +1 -0
  47. package/dist/enums/raw/Notification.d.ts +11 -0
  48. package/dist/enums/raw/Notification.js +16 -0
  49. package/dist/enums/raw/Notification.js.map +1 -0
  50. package/dist/enums/raw/Tweet.d.ts +9 -0
  51. package/dist/enums/raw/Tweet.js +14 -0
  52. package/dist/enums/raw/Tweet.js.map +1 -0
  53. package/dist/helper/CliUtils.js +1 -2
  54. package/dist/helper/CliUtils.js.map +1 -1
  55. package/dist/helper/JsonUtils.js +6 -11
  56. package/dist/helper/JsonUtils.js.map +1 -1
  57. package/dist/helper/TidUtils.d.ts +2 -0
  58. package/dist/helper/TidUtils.js +162 -0
  59. package/dist/helper/TidUtils.js.map +1 -0
  60. package/dist/index.d.ts +75 -5
  61. package/dist/index.js +26 -6
  62. package/dist/index.js.map +1 -1
  63. package/dist/models/RettiwtConfig.d.ts +28 -0
  64. package/dist/models/RettiwtConfig.js +55 -0
  65. package/dist/models/RettiwtConfig.js.map +1 -0
  66. package/dist/models/args/FetchArgs.d.ts +16 -102
  67. package/dist/models/args/FetchArgs.js +105 -407
  68. package/dist/models/args/FetchArgs.js.map +1 -1
  69. package/dist/models/args/PostArgs.d.ts +16 -73
  70. package/dist/models/args/PostArgs.js +43 -236
  71. package/dist/models/args/PostArgs.js.map +1 -1
  72. package/dist/models/auth/AuthCookie.d.ts +21 -0
  73. package/dist/models/auth/AuthCookie.js +55 -0
  74. package/dist/models/auth/AuthCookie.js.map +1 -0
  75. package/dist/models/auth/AuthCredential.d.ts +30 -0
  76. package/dist/models/auth/AuthCredential.js +78 -0
  77. package/dist/models/auth/AuthCredential.js.map +1 -0
  78. package/dist/models/data/CursoredData.d.ts +5 -15
  79. package/dist/models/data/CursoredData.js +25 -32
  80. package/dist/models/data/CursoredData.js.map +1 -1
  81. package/dist/models/data/List.d.ts +7 -9
  82. package/dist/models/data/List.js +24 -4
  83. package/dist/models/data/List.js.map +1 -1
  84. package/dist/models/data/Notification.d.ts +10 -24
  85. package/dist/models/data/Notification.js +38 -36
  86. package/dist/models/data/Notification.js.map +1 -1
  87. package/dist/models/data/Tweet.d.ts +34 -31
  88. package/dist/models/data/Tweet.js +186 -112
  89. package/dist/models/data/Tweet.js.map +1 -1
  90. package/dist/models/data/User.d.ts +19 -23
  91. package/dist/models/data/User.js +92 -32
  92. package/dist/models/data/User.js.map +1 -1
  93. package/dist/models/errors/ApiError.js +8 -24
  94. package/dist/models/errors/ApiError.js.map +1 -1
  95. package/dist/models/errors/HttpError.js +8 -24
  96. package/dist/models/errors/HttpError.js.map +1 -1
  97. package/dist/models/errors/RettiwtError.d.ts +3 -2
  98. package/dist/models/errors/RettiwtError.js +8 -25
  99. package/dist/models/errors/RettiwtError.js.map +1 -1
  100. package/dist/models/errors/TimeoutError.js +5 -22
  101. package/dist/models/errors/TimeoutError.js.map +1 -1
  102. package/dist/models/params/Variables.d.ts +41 -0
  103. package/dist/models/params/Variables.js +61 -0
  104. package/dist/models/params/Variables.js.map +1 -0
  105. package/dist/requests/List.d.ts +24 -0
  106. package/dist/requests/List.js +122 -0
  107. package/dist/requests/List.js.map +1 -0
  108. package/dist/requests/Media.d.ts +21 -0
  109. package/dist/requests/Media.js +70 -0
  110. package/dist/requests/Media.js.map +1 -0
  111. package/dist/requests/Tweet.d.ts +75 -0
  112. package/dist/requests/Tweet.js +480 -0
  113. package/dist/requests/Tweet.js.map +1 -0
  114. package/dist/requests/User.d.ts +111 -0
  115. package/dist/requests/User.js +762 -0
  116. package/dist/requests/User.js.map +1 -0
  117. package/dist/services/internal/AuthService.d.ts +60 -0
  118. package/dist/services/internal/AuthService.js +106 -0
  119. package/dist/services/internal/AuthService.js.map +1 -0
  120. package/dist/services/internal/ErrorService.js +38 -40
  121. package/dist/services/internal/ErrorService.js.map +1 -1
  122. package/dist/services/internal/LogService.d.ts +0 -6
  123. package/dist/services/internal/LogService.js +12 -32
  124. package/dist/services/internal/LogService.js.map +1 -1
  125. package/dist/services/internal/TidService.d.ts +44 -0
  126. package/dist/services/internal/TidService.js +162 -0
  127. package/dist/services/internal/TidService.js.map +1 -0
  128. package/dist/services/public/FetcherService.d.ts +22 -19
  129. package/dist/services/public/FetcherService.js +126 -153
  130. package/dist/services/public/FetcherService.js.map +1 -1
  131. package/dist/services/public/ListService.d.ts +2 -2
  132. package/dist/services/public/ListService.js +31 -100
  133. package/dist/services/public/ListService.js.map +1 -1
  134. package/dist/services/public/TweetService.d.ts +63 -10
  135. package/dist/services/public/TweetService.js +255 -387
  136. package/dist/services/public/TweetService.js.map +1 -1
  137. package/dist/services/public/UserService.d.ts +4 -4
  138. package/dist/services/public/UserService.js +199 -386
  139. package/dist/services/public/UserService.js.map +1 -1
  140. package/dist/types/RettiwtConfig.d.ts +17 -10
  141. package/dist/types/args/FetchArgs.d.ts +123 -0
  142. package/dist/types/{ReturnTypes.js → args/FetchArgs.js} +1 -1
  143. package/dist/types/args/FetchArgs.js.map +1 -0
  144. package/dist/types/args/PostArgs.d.ts +100 -0
  145. package/dist/types/args/PostArgs.js +3 -0
  146. package/dist/types/args/PostArgs.js.map +1 -0
  147. package/dist/types/auth/AuthCookie.d.ts +15 -0
  148. package/dist/types/auth/AuthCookie.js +3 -0
  149. package/dist/types/auth/AuthCookie.js.map +1 -0
  150. package/dist/types/auth/AuthCredential.d.ts +23 -0
  151. package/dist/types/auth/AuthCredential.js +3 -0
  152. package/dist/types/auth/AuthCredential.js.map +1 -0
  153. package/dist/types/auth/TidDynamicArgs.d.ts +10 -0
  154. package/dist/types/auth/TidDynamicArgs.js +3 -0
  155. package/dist/types/auth/TidDynamicArgs.js.map +1 -0
  156. package/dist/types/auth/TidHeader.d.ts +8 -0
  157. package/dist/types/auth/TidHeader.js +3 -0
  158. package/dist/types/auth/TidHeader.js.map +1 -0
  159. package/dist/types/auth/TidParams.d.ts +27 -0
  160. package/dist/types/auth/TidParams.js +3 -0
  161. package/dist/types/auth/TidParams.js.map +1 -0
  162. package/dist/types/auth/TidProvider.d.ts +18 -0
  163. package/dist/types/auth/TidProvider.js +3 -0
  164. package/dist/types/auth/TidProvider.js.map +1 -0
  165. package/dist/types/data/CursoredData.d.ts +16 -0
  166. package/dist/types/data/CursoredData.js +3 -0
  167. package/dist/types/data/CursoredData.js.map +1 -0
  168. package/dist/types/data/List.d.ts +21 -0
  169. package/dist/types/data/List.js +3 -0
  170. package/dist/types/data/List.js.map +1 -0
  171. package/dist/types/data/Notification.d.ts +20 -0
  172. package/dist/types/data/Notification.js +3 -0
  173. package/dist/types/data/Notification.js.map +1 -0
  174. package/dist/types/data/Tweet.d.ts +71 -0
  175. package/dist/types/data/Tweet.js +3 -0
  176. package/dist/types/data/Tweet.js.map +1 -0
  177. package/dist/types/data/User.d.ts +35 -0
  178. package/dist/types/data/User.js +3 -0
  179. package/dist/types/data/User.js.map +1 -0
  180. package/dist/types/params/Variables.d.ts +27 -0
  181. package/dist/types/params/Variables.js +3 -0
  182. package/dist/types/params/Variables.js.map +1 -0
  183. package/dist/types/raw/base/Analytic.d.ts +21 -0
  184. package/dist/types/raw/base/Analytic.js +4 -0
  185. package/dist/types/raw/base/Analytic.js.map +1 -0
  186. package/dist/types/raw/base/Cursor.d.ts +11 -0
  187. package/dist/types/raw/base/Cursor.js +4 -0
  188. package/dist/types/raw/base/Cursor.js.map +1 -0
  189. package/dist/types/raw/base/LimitedVisibilityTweet.d.ts +32 -0
  190. package/dist/types/raw/base/LimitedVisibilityTweet.js +4 -0
  191. package/dist/types/raw/base/LimitedVisibilityTweet.js.map +1 -0
  192. package/dist/types/raw/base/List.d.ts +43 -0
  193. package/dist/types/raw/base/List.js +4 -0
  194. package/dist/types/raw/base/List.js.map +1 -0
  195. package/dist/types/raw/base/Media.d.ts +43 -0
  196. package/dist/types/raw/base/Media.js +4 -0
  197. package/dist/types/raw/base/Media.js.map +1 -0
  198. package/dist/types/raw/base/Notification.d.ts +53 -0
  199. package/dist/types/raw/base/Notification.js +4 -0
  200. package/dist/types/raw/base/Notification.js.map +1 -0
  201. package/dist/types/raw/base/Space.d.ts +32 -0
  202. package/dist/types/raw/base/Space.js +4 -0
  203. package/dist/types/raw/base/Space.js.map +1 -0
  204. package/dist/types/raw/base/Tweet.d.ts +119 -0
  205. package/dist/types/raw/base/Tweet.js +4 -0
  206. package/dist/types/raw/base/Tweet.js.map +1 -0
  207. package/dist/types/raw/base/User.d.ts +140 -0
  208. package/dist/types/raw/base/User.js +4 -0
  209. package/dist/types/raw/base/User.js.map +1 -0
  210. package/dist/types/raw/composite/DataResult.d.ts +8 -0
  211. package/dist/types/raw/composite/DataResult.js +3 -0
  212. package/dist/types/raw/composite/DataResult.js.map +1 -0
  213. package/dist/types/raw/composite/TimelineTweet.d.ts +11 -0
  214. package/dist/types/raw/composite/TimelineTweet.js +4 -0
  215. package/dist/types/raw/composite/TimelineTweet.js.map +1 -0
  216. package/dist/types/raw/composite/TimelineUser.d.ts +10 -0
  217. package/dist/types/raw/composite/TimelineUser.js +4 -0
  218. package/dist/types/raw/composite/TimelineUser.js.map +1 -0
  219. package/dist/types/raw/generic/Error.d.ts +30 -0
  220. package/dist/types/raw/generic/Error.js +3 -0
  221. package/dist/types/raw/generic/Error.js.map +1 -0
  222. package/dist/types/raw/generic/Response.d.ts +12 -0
  223. package/dist/types/raw/generic/Response.js +3 -0
  224. package/dist/types/raw/generic/Response.js.map +1 -0
  225. package/dist/types/raw/list/Details.d.ts +122 -0
  226. package/dist/types/raw/list/Details.js +4 -0
  227. package/dist/types/raw/list/Details.js.map +1 -0
  228. package/dist/types/raw/list/Members.d.ts +134 -0
  229. package/dist/types/raw/list/Members.js +4 -0
  230. package/dist/types/raw/list/Members.js.map +1 -0
  231. package/dist/types/raw/list/Tweets.d.ts +1968 -0
  232. package/dist/types/raw/list/Tweets.js +4 -0
  233. package/dist/types/raw/list/Tweets.js.map +1 -0
  234. package/dist/types/raw/media/FinalizeUpload.d.ts +18 -0
  235. package/dist/types/raw/media/FinalizeUpload.js +4 -0
  236. package/dist/types/raw/media/FinalizeUpload.js.map +1 -0
  237. package/dist/types/raw/media/InitalizeUpload.d.ts +10 -0
  238. package/dist/types/raw/media/InitalizeUpload.js +4 -0
  239. package/dist/types/raw/media/InitalizeUpload.js.map +1 -0
  240. package/dist/types/raw/media/LiveVideoStream.d.ts +19 -0
  241. package/dist/types/raw/media/LiveVideoStream.js +4 -0
  242. package/dist/types/raw/media/LiveVideoStream.js.map +1 -0
  243. package/dist/types/raw/space/Details.d.ts +315 -0
  244. package/dist/types/raw/space/Details.js +4 -0
  245. package/dist/types/raw/space/Details.js.map +1 -0
  246. package/dist/types/raw/tweet/Details.d.ts +183 -0
  247. package/dist/types/raw/tweet/Details.js +4 -0
  248. package/dist/types/raw/tweet/Details.js.map +1 -0
  249. package/dist/types/raw/tweet/Like.d.ts +12 -0
  250. package/dist/types/raw/tweet/Like.js +4 -0
  251. package/dist/types/raw/tweet/Like.js.map +1 -0
  252. package/dist/types/raw/tweet/Likers.d.ts +170 -0
  253. package/dist/types/raw/tweet/Likers.js +4 -0
  254. package/dist/types/raw/tweet/Likers.js.map +1 -0
  255. package/dist/types/raw/tweet/Post.d.ts +133 -0
  256. package/dist/types/raw/tweet/Post.js +4 -0
  257. package/dist/types/raw/tweet/Post.js.map +1 -0
  258. package/dist/types/raw/tweet/Replies.d.ts +465 -0
  259. package/dist/types/raw/tweet/Replies.js +4 -0
  260. package/dist/types/raw/tweet/Replies.js.map +1 -0
  261. package/dist/types/raw/tweet/Retweet.d.ts +25 -0
  262. package/dist/types/raw/tweet/Retweet.js +4 -0
  263. package/dist/types/raw/tweet/Retweet.js.map +1 -0
  264. package/dist/types/raw/tweet/Retweeters.d.ts +177 -0
  265. package/dist/types/raw/tweet/Retweeters.js +4 -0
  266. package/dist/types/raw/tweet/Retweeters.js.map +1 -0
  267. package/dist/types/raw/tweet/Schedule.d.ts +15 -0
  268. package/dist/types/raw/tweet/Schedule.js +4 -0
  269. package/dist/types/raw/tweet/Schedule.js.map +1 -0
  270. package/dist/types/raw/tweet/Search.d.ts +518 -0
  271. package/dist/types/raw/tweet/Search.js +4 -0
  272. package/dist/types/raw/tweet/Search.js.map +1 -0
  273. package/dist/types/raw/tweet/Unlike.d.ts +12 -0
  274. package/dist/types/raw/tweet/Unlike.js +4 -0
  275. package/dist/types/raw/tweet/Unlike.js.map +1 -0
  276. package/dist/types/raw/tweet/Unpost.d.ts +17 -0
  277. package/dist/types/raw/tweet/Unpost.js +4 -0
  278. package/dist/types/raw/tweet/Unpost.js.map +1 -0
  279. package/dist/types/raw/tweet/Unretweet.d.ts +25 -0
  280. package/dist/types/raw/tweet/Unretweet.js +4 -0
  281. package/dist/types/raw/tweet/Unretweet.js.map +1 -0
  282. package/dist/types/raw/tweet/Unschedule.d.ts +12 -0
  283. package/dist/types/raw/tweet/Unschedule.js +4 -0
  284. package/dist/types/raw/tweet/Unschedule.js.map +1 -0
  285. package/dist/types/raw/user/Affiliates.d.ts +154 -0
  286. package/dist/types/raw/user/Affiliates.js +4 -0
  287. package/dist/types/raw/user/Affiliates.js.map +1 -0
  288. package/dist/types/raw/user/Analytics.d.ts +32 -0
  289. package/dist/types/raw/user/Analytics.js +4 -0
  290. package/dist/types/raw/user/Analytics.js.map +1 -0
  291. package/dist/types/raw/user/Bookmarks.d.ts +550 -0
  292. package/dist/types/raw/user/Bookmarks.js +4 -0
  293. package/dist/types/raw/user/Bookmarks.js.map +1 -0
  294. package/dist/types/raw/user/Details.d.ts +157 -0
  295. package/dist/types/raw/user/Details.js +4 -0
  296. package/dist/types/raw/user/Details.js.map +1 -0
  297. package/dist/types/raw/user/Follow.d.ts +248 -0
  298. package/dist/types/raw/user/Follow.js +4 -0
  299. package/dist/types/raw/user/Follow.js.map +1 -0
  300. package/dist/types/raw/user/Followed.d.ts +1666 -0
  301. package/dist/types/raw/user/Followed.js +4 -0
  302. package/dist/types/raw/user/Followed.js.map +1 -0
  303. package/dist/types/raw/user/Followers.d.ts +182 -0
  304. package/dist/types/raw/user/Followers.js +4 -0
  305. package/dist/types/raw/user/Followers.js.map +1 -0
  306. package/dist/types/raw/user/Following.d.ts +182 -0
  307. package/dist/types/raw/user/Following.js +4 -0
  308. package/dist/types/raw/user/Following.js.map +1 -0
  309. package/dist/types/raw/user/Highlights.d.ts +1106 -0
  310. package/dist/types/raw/user/Highlights.js +4 -0
  311. package/dist/types/raw/user/Highlights.js.map +1 -0
  312. package/dist/types/raw/user/Likes.d.ts +1065 -0
  313. package/dist/types/raw/user/Likes.js +4 -0
  314. package/dist/types/raw/user/Likes.js.map +1 -0
  315. package/dist/types/raw/user/Media.d.ts +1492 -0
  316. package/dist/types/raw/user/Media.js +4 -0
  317. package/dist/types/raw/user/Media.js.map +1 -0
  318. package/dist/types/raw/user/Notifications.d.ts +142 -0
  319. package/dist/types/raw/user/Notifications.js +4 -0
  320. package/dist/types/raw/user/Notifications.js.map +1 -0
  321. package/dist/types/raw/user/Recommended.d.ts +1991 -0
  322. package/dist/types/raw/user/Recommended.js +4 -0
  323. package/dist/types/raw/user/Recommended.js.map +1 -0
  324. package/dist/types/raw/user/Scheduled.d.ts +31 -0
  325. package/dist/types/raw/user/Scheduled.js +4 -0
  326. package/dist/types/raw/user/Scheduled.js.map +1 -0
  327. package/dist/types/raw/user/Subscriptions.d.ts +151 -0
  328. package/dist/types/raw/user/Subscriptions.js +4 -0
  329. package/dist/types/raw/user/Subscriptions.js.map +1 -0
  330. package/dist/types/raw/user/Tweets.d.ts +1065 -0
  331. package/dist/types/raw/user/Tweets.js +4 -0
  332. package/dist/types/raw/user/Tweets.js.map +1 -0
  333. package/dist/types/raw/user/TweetsAndReplies.d.ts +1065 -0
  334. package/dist/types/raw/user/TweetsAndReplies.js +4 -0
  335. package/dist/types/raw/user/TweetsAndReplies.js.map +1 -0
  336. package/dist/types/raw/user/Unfollow.d.ts +248 -0
  337. package/dist/types/raw/user/Unfollow.js +4 -0
  338. package/dist/types/raw/user/Unfollow.js.map +1 -0
  339. package/eslint.config.mjs +17 -0
  340. package/package.json +22 -19
  341. package/src/Rettiwt.ts +22 -7
  342. package/src/cli.ts +0 -2
  343. package/src/collections/Extractors.ts +40 -34
  344. package/src/collections/Groups.ts +4 -0
  345. package/src/collections/Requests.ts +46 -44
  346. package/src/commands/Tweet.ts +35 -7
  347. package/src/commands/User.ts +13 -2
  348. package/src/enums/Authentication.ts +10 -0
  349. package/src/enums/Data.ts +3 -3
  350. package/src/enums/Media.ts +10 -0
  351. package/src/enums/Notification.ts +12 -0
  352. package/src/enums/Resource.ts +4 -0
  353. package/src/enums/raw/Analytics.ts +29 -0
  354. package/src/enums/raw/Media.ts +10 -0
  355. package/src/enums/raw/Notification.ts +11 -0
  356. package/src/enums/raw/Tweet.ts +9 -0
  357. package/src/helper/JsonUtils.ts +1 -1
  358. package/src/helper/TidUtils.ts +189 -0
  359. package/src/index.ts +78 -44
  360. package/src/models/RettiwtConfig.ts +64 -0
  361. package/src/models/args/FetchArgs.ts +86 -436
  362. package/src/models/args/PostArgs.ts +24 -249
  363. package/src/models/auth/AuthCookie.ts +58 -0
  364. package/src/models/auth/AuthCredential.ts +85 -0
  365. package/src/models/data/CursoredData.ts +21 -26
  366. package/src/models/data/List.ts +18 -15
  367. package/src/models/data/Notification.ts +25 -38
  368. package/src/models/data/Tweet.ts +143 -104
  369. package/src/models/data/User.ts +74 -44
  370. package/src/models/errors/RettiwtError.ts +3 -2
  371. package/src/models/params/Variables.ts +62 -0
  372. package/src/requests/List.ts +121 -0
  373. package/src/requests/Media.ts +67 -0
  374. package/src/requests/Tweet.ts +496 -0
  375. package/src/requests/User.ts +783 -0
  376. package/src/services/{public → internal}/AuthService.ts +28 -60
  377. package/src/services/internal/LogService.ts +4 -19
  378. package/src/services/internal/TidService.ts +147 -0
  379. package/src/services/public/FetcherService.ts +89 -59
  380. package/src/services/public/ListService.ts +4 -4
  381. package/src/services/public/TweetService.ts +129 -42
  382. package/src/services/public/UserService.ts +49 -37
  383. package/src/types/RettiwtConfig.ts +18 -12
  384. package/src/types/args/FetchArgs.ts +148 -0
  385. package/src/types/args/PostArgs.ts +112 -0
  386. package/src/types/auth/AuthCookie.ts +22 -0
  387. package/src/types/auth/AuthCredential.ts +28 -0
  388. package/src/types/auth/TidDynamicArgs.ts +10 -0
  389. package/src/types/auth/TidHeader.ts +12 -0
  390. package/src/types/auth/TidParams.ts +36 -0
  391. package/src/types/auth/TidProvider.ts +19 -0
  392. package/src/types/data/CursoredData.ts +18 -0
  393. package/src/types/data/List.ts +27 -0
  394. package/src/types/data/Notification.ts +26 -0
  395. package/src/types/data/Tweet.ts +96 -0
  396. package/src/types/data/User.ts +48 -0
  397. package/src/types/params/Variables.ts +41 -0
  398. package/src/types/raw/base/Analytic.ts +26 -0
  399. package/src/types/raw/base/Cursor.ts +13 -0
  400. package/src/types/raw/base/LimitedVisibilityTweet.ts +40 -0
  401. package/src/types/raw/base/List.ts +50 -0
  402. package/src/types/raw/base/Media.ts +53 -0
  403. package/src/types/raw/base/Notification.ts +67 -0
  404. package/src/types/raw/base/Space.ts +35 -0
  405. package/src/types/raw/base/Tweet.ts +139 -0
  406. package/src/types/raw/base/User.ts +164 -0
  407. package/src/types/raw/composite/DataResult.ts +8 -0
  408. package/src/types/raw/composite/TimelineTweet.ts +14 -0
  409. package/src/types/raw/composite/TimelineUser.ts +13 -0
  410. package/src/types/raw/generic/Error.ts +35 -0
  411. package/src/types/raw/generic/Response.ts +13 -0
  412. package/src/types/raw/list/Details.ts +137 -0
  413. package/src/types/raw/list/Members.ts +154 -0
  414. package/src/types/raw/list/Tweets.ts +2296 -0
  415. package/src/types/raw/media/FinalizeUpload.ts +20 -0
  416. package/src/types/raw/media/InitalizeUpload.ts +12 -0
  417. package/src/types/raw/media/LiveVideoStream.ts +21 -0
  418. package/src/types/raw/space/Details.ts +359 -0
  419. package/src/types/raw/tweet/Details.ts +210 -0
  420. package/src/types/raw/tweet/Like.ts +14 -0
  421. package/src/types/raw/tweet/Likers.ts +200 -0
  422. package/src/types/raw/tweet/Post.ts +150 -0
  423. package/src/types/raw/tweet/Replies.ts +539 -0
  424. package/src/types/raw/tweet/Retweet.ts +31 -0
  425. package/src/types/raw/tweet/Retweeters.ts +208 -0
  426. package/src/types/raw/tweet/Schedule.ts +18 -0
  427. package/src/types/raw/tweet/Search.ts +597 -0
  428. package/src/types/raw/tweet/Unlike.ts +14 -0
  429. package/src/types/raw/tweet/Unpost.ts +20 -0
  430. package/src/types/raw/tweet/Unretweet.ts +31 -0
  431. package/src/types/raw/tweet/Unschedule.ts +14 -0
  432. package/src/types/raw/user/Affiliates.ts +179 -0
  433. package/src/types/raw/user/Analytics.ts +39 -0
  434. package/src/types/raw/user/Bookmarks.ts +637 -0
  435. package/src/types/raw/user/Details.ts +185 -0
  436. package/src/types/raw/user/Follow.ts +280 -0
  437. package/src/types/raw/user/Followed.ts +1942 -0
  438. package/src/types/raw/user/Followers.ts +215 -0
  439. package/src/types/raw/user/Following.ts +215 -0
  440. package/src/types/raw/user/Highlights.ts +1287 -0
  441. package/src/types/raw/user/Likes.ts +1254 -0
  442. package/src/types/raw/user/Media.ts +1738 -0
  443. package/src/types/raw/user/Notifications.ts +175 -0
  444. package/src/types/raw/user/Recommended.ts +2319 -0
  445. package/src/types/raw/user/Scheduled.ts +37 -0
  446. package/src/types/raw/user/Subscriptions.ts +176 -0
  447. package/src/types/raw/user/Tweets.ts +1254 -0
  448. package/src/types/raw/user/TweetsAndReplies.ts +1254 -0
  449. package/src/types/raw/user/Unfollow.ts +280 -0
  450. package/tsconfig.json +7 -5
  451. package/.eslintignore +0 -3
  452. package/dist/commands/Auth.d.ts +0 -10
  453. package/dist/commands/Auth.js +0 -101
  454. package/dist/commands/Auth.js.map +0 -1
  455. package/dist/models/errors/DataValidationError.d.ts +0 -30
  456. package/dist/models/errors/DataValidationError.js +0 -34
  457. package/dist/models/errors/DataValidationError.js.map +0 -1
  458. package/dist/services/public/AuthService.d.ts +0 -91
  459. package/dist/services/public/AuthService.js +0 -205
  460. package/dist/services/public/AuthService.js.map +0 -1
  461. package/dist/types/ReturnTypes.d.ts +0 -21
  462. package/dist/types/ReturnTypes.js.map +0 -1
  463. package/src/commands/Auth.ts +0 -46
  464. package/src/models/errors/DataValidationError.ts +0 -44
  465. package/src/types/ReturnTypes.ts +0 -24
@@ -0,0 +1,112 @@
1
+ /**
2
+ * Options specifying the data that is to be posted.
3
+ *
4
+ * @public
5
+ */
6
+ export interface IPostArgs {
7
+ /**
8
+ * The id of the target resource.
9
+ *
10
+ * @remarks
11
+ * Required only when posting using the following resources:
12
+ * - {@link EResourceType.TWEET_LIKE}
13
+ * - {@link EResourceType.TWEET_RETWEET}
14
+ * - {@link EResourceType.TWEET_UNLIKE}
15
+ * - {@link EResourceType.TWEET_UNPOST}
16
+ * - {@link EResourceType.TWEET_UNRETWEET}
17
+ * - {@link EResourceType.USER_FOLLOW}
18
+ * - {@link EResourceType.USER_UNFOLLOW}
19
+ */
20
+ id?: string;
21
+
22
+ /**
23
+ * The tweet that is to be posted.
24
+ *
25
+ * @remarks
26
+ * Required only when posting a tweet using {@link EResourceType.TWEET_POST}
27
+ */
28
+ tweet?: INewTweet;
29
+
30
+ /**
31
+ * The media file to be uploaded.
32
+ *
33
+ * @remarks
34
+ * Required only when uploading a media using the following resources:
35
+ * - {@link EResourceType.MEDIA_UPLOAD_APPEND}
36
+ * - {@link EResourceType.MEDIA_UPLOAD_FINALIZE}
37
+ * - {@link EResourceType.MEDIA_UPLOAD_INITIALIZE}
38
+ */
39
+ upload?: IUploadArgs;
40
+ }
41
+
42
+ /**
43
+ * Configuration for the new tweet to be posted.
44
+ *
45
+ * @public
46
+ */
47
+ export interface INewTweet {
48
+ /**
49
+ * The list of media to be uploaded.
50
+ *
51
+ * @remarks
52
+ * - The media first needs to be uploaded.
53
+ * - After uploading, the returned id(s) can be used to reference the media here.
54
+ * - Maximum number of media items that can be posted is 4.
55
+ */
56
+ media?: INewTweetMedia[];
57
+
58
+ /** The id of the tweet to quote. */
59
+ quote?: string;
60
+
61
+ /** The id of the Tweet to which the given Tweet must be a reply. */
62
+ replyTo?: string;
63
+
64
+ /** The date/time at which the tweet is to be scheduled for posting. */
65
+ scheduleFor?: Date;
66
+
67
+ /**
68
+ * The text for the tweet to be created.
69
+ *
70
+ * @remarks
71
+ * Length of the tweet must be \<= 280 characters.
72
+ */
73
+ text?: string;
74
+ }
75
+
76
+ /**
77
+ * Configuration for the media to be uploaded.
78
+ *
79
+ * @public
80
+ */
81
+ export interface INewTweetMedia {
82
+ /** The id of the media to upload. */
83
+ id: string;
84
+
85
+ /**
86
+ * The list of id of the users to tag in the media.
87
+ *
88
+ * @remarks
89
+ * Maximum number of users that can be tagged is 10.
90
+ */
91
+ tags?: string[];
92
+ }
93
+
94
+ /**
95
+ * Options specifying the media file to be uploaded.
96
+ *
97
+ * @public
98
+ */
99
+ export interface IUploadArgs {
100
+ /** The id allocated to the media file to be uploaded. */
101
+ id?: string;
102
+
103
+ /** The media file to be uploaded. */
104
+ media?: string | ArrayBuffer;
105
+
106
+ /**
107
+ * The size (in bytes) of the media file to be uploaded.
108
+ *
109
+ * @remarks The size must be \<= 5242880 bytes.
110
+ */
111
+ size?: number;
112
+ }
@@ -0,0 +1,22 @@
1
+ /**
2
+ * The cookie containing the tokens that are used to authenticate against Twitter.
3
+ *
4
+ * @public
5
+ */
6
+ export interface IAuthCookie {
7
+ /* eslint-disable @typescript-eslint/naming-convention */
8
+
9
+ /** The bearer token from twitter.com. */
10
+ auth_token: string;
11
+
12
+ /** The CSRF token for the session. */
13
+ ct0: string;
14
+
15
+ /** Token used to authenticate a device. */
16
+ kdt: string;
17
+
18
+ /** Token used to authenticate a user using a Twitter ID. */
19
+ twid: string;
20
+
21
+ /* eslint-enable @typescript-eslint/naming-convention */
22
+ }
@@ -0,0 +1,28 @@
1
+ import { EAuthenticationType } from '../../enums/Authentication';
2
+
3
+ /**
4
+ * The credentials for authenticating against Twitter.
5
+ *
6
+ * Depending on which tokens are present, the authentication type is determined as follows:
7
+ * - authToken, guestToken =\> Guest authentication.
8
+ * - authToken, csrfToken, cookie =\> User authentication.
9
+ * - authToken, guestToken, cookie =\> Guest authentication while logging in.
10
+ *
11
+ * @public
12
+ */
13
+ export interface IAuthCredential {
14
+ /** The bearer token from twitter.com. */
15
+ authToken?: string;
16
+
17
+ /** The type of authentication. */
18
+ authenticationType?: EAuthenticationType;
19
+
20
+ /** The cookie of the twitter account, which is used to authenticate against twitter. */
21
+ cookies?: string;
22
+
23
+ /** The CSRF token for the session. */
24
+ csrfToken?: string;
25
+
26
+ /** The guest token provided by Twitter API. */
27
+ guestToken?: string;
28
+ }
@@ -0,0 +1,10 @@
1
+ /**
2
+ * Internal args used for generating trasaction ID.
3
+ *
4
+ * @internal
5
+ */
6
+ export interface ITidDynamicArgs {
7
+ verificationKey: string;
8
+ frames: number[][][];
9
+ indices: number[];
10
+ }
@@ -0,0 +1,12 @@
1
+ /**
2
+ * The header for the transaction ID.
3
+ *
4
+ * @public
5
+ */
6
+ export interface ITidHeader {
7
+ /* eslint-disable @typescript-eslint/naming-convention */
8
+
9
+ 'x-client-transaction-id': string;
10
+
11
+ /* eslint-enable @typescript-eslint/naming-convention */
12
+ }
@@ -0,0 +1,36 @@
1
+ /**
2
+ * The parameters for generating the transaction ID.
3
+ *
4
+ * @internal
5
+ */
6
+ export interface ITidParams {
7
+ /** Secret used for transaction ID calculation. */
8
+ keyword: string;
9
+
10
+ /** Request method. */
11
+ method: string;
12
+
13
+ /** Endpoint path without query parameters. */
14
+ path: string;
15
+
16
+ /** Twitter verification key received from HTML. */
17
+ verificationKey: string;
18
+
19
+ /** Animation frames extracted from HTML. */
20
+ frames: number[][][];
21
+
22
+ /** Indices used for getting the correct verification key bytes during animation key calculation. */
23
+ indices: number[];
24
+
25
+ /** Final byte of the transaction ID. */
26
+ extraByte: number;
27
+
28
+ /** Current time */
29
+ time?: number;
30
+
31
+ /** XOR byte used for final hash calculation, must be in 0-255 range. */
32
+ xorByte?: number;
33
+
34
+ /** Precomputed animation key. */
35
+ animationKey?: string;
36
+ }
@@ -0,0 +1,19 @@
1
+ /**
2
+ * Service responsible for generating the `x-client-transaction-id` header.
3
+ *
4
+ * @public
5
+ */
6
+ export interface ITidProvider {
7
+ /**
8
+ * Generates new `x-client-transaction-id` header.
9
+ *
10
+ * @param method - Request method.
11
+ * @param path - Endpoint path without query parameters.
12
+ */
13
+ generate(method: string, path: string): Promise<string | undefined>;
14
+
15
+ /**
16
+ * Refresh arguments obtained from parsing the HTML page, if any.
17
+ */
18
+ refreshDynamicArgs(): Promise<void>;
19
+ }
@@ -0,0 +1,18 @@
1
+ import { INotification } from './Notification';
2
+ import { ITweet } from './Tweet';
3
+ import { IUser } from './User';
4
+
5
+ /**
6
+ * The data that is fetched batch-wise using a cursor.
7
+ *
8
+ * @typeParam T - Type of data to be stored.
9
+ *
10
+ * @public
11
+ */
12
+ export interface ICursoredData<T extends INotification | ITweet | IUser> {
13
+ /** The batch of data of the given type. */
14
+ list: T[];
15
+
16
+ /** The cursor to the next batch of data. */
17
+ next: string;
18
+ }
@@ -0,0 +1,27 @@
1
+ /**
2
+ * The details of a single Twitter List.
3
+ *
4
+ * @public
5
+ */
6
+ export interface IList {
7
+ /** The date and time of creation of the list, int UTC string format. */
8
+ createdAt: string;
9
+
10
+ /** The rest id of the user who created the list. */
11
+ createdBy: string;
12
+
13
+ /** The list description. */
14
+ description?: string;
15
+
16
+ /** The rest id of the list. */
17
+ id: string;
18
+
19
+ /** The number of memeber of the list. */
20
+ memberCount: number;
21
+
22
+ /** The name of the list. */
23
+ name: string;
24
+
25
+ /** The number of subscribers of the list. */
26
+ subscriberCount: number;
27
+ }
@@ -0,0 +1,26 @@
1
+ import { ENotificationType } from '../../enums/Notification';
2
+
3
+ /**
4
+ * The details of a single notification.
5
+ *
6
+ * @public
7
+ */
8
+ export interface INotification {
9
+ /** The list of id of the users from whom the notification was received. */
10
+ from: string[];
11
+
12
+ /** The id of the notification. */
13
+ id: string;
14
+
15
+ /** The text contents of the notification. */
16
+ message: string;
17
+
18
+ /** The date/time at which the notification was received. */
19
+ receivedAt: string;
20
+
21
+ /** The list of id of the target tweet(s) of the notification. */
22
+ target: string[];
23
+
24
+ /** The type of notification. */
25
+ type?: ENotificationType;
26
+ }
@@ -0,0 +1,96 @@
1
+ import { EMediaType } from '../../enums/Media';
2
+
3
+ import { IUser } from './User';
4
+
5
+ /**
6
+ * The details of a single tweet.
7
+ *
8
+ * @public
9
+ */
10
+ export interface ITweet {
11
+ /** The number of bookmarks of a tweet. */
12
+ bookmarkCount: number;
13
+
14
+ /** The ID of tweet which started the current conversation. */
15
+ conversationId: string;
16
+
17
+ /** The creation date of the tweet. */
18
+ createdAt: string;
19
+
20
+ /** Additional tweet entities like urls, mentions, etc. */
21
+ entities: ITweetEntities;
22
+
23
+ /** The full text content of the tweet. */
24
+ fullText: string;
25
+
26
+ /** The rest id of the tweet. */
27
+ id: string;
28
+
29
+ /** The language in which the tweet is written. */
30
+ lang: string;
31
+
32
+ /** The number of likes of the tweet. */
33
+ likeCount: number;
34
+
35
+ /** The urls of the media contents of the tweet (if any). */
36
+ media?: ITweetMedia[];
37
+
38
+ /** The number of quotes of the tweet. */
39
+ quoteCount: number;
40
+
41
+ /** The tweet which is quoted in the tweet. */
42
+ quoted?: ITweet;
43
+
44
+ /** The number of replies to the tweet. */
45
+ replyCount: number;
46
+
47
+ /** The rest id of the tweet to which the tweet is a reply. */
48
+ replyTo?: string;
49
+
50
+ /** The number of retweets of the tweet. */
51
+ retweetCount: number;
52
+
53
+ /** The tweet which is retweeted in this tweet (if any). */
54
+ retweetedTweet?: ITweet;
55
+
56
+ /** The details of the user who made the tweet. */
57
+ tweetBy: IUser;
58
+
59
+ /** The URL to the tweet. */
60
+ url: string;
61
+
62
+ /** The number of views of a tweet. */
63
+ viewCount: number;
64
+ }
65
+
66
+ /**
67
+ * The different types parsed entities like urls, media, mentions, hashtags, etc.
68
+ *
69
+ * @public
70
+ */
71
+ export interface ITweetEntities {
72
+ /** The list of hashtags mentioned in the tweet. */
73
+ hashtags: string[];
74
+
75
+ /** The list of IDs of users mentioned in the tweet. */
76
+ mentionedUsers: string[];
77
+
78
+ /** The list of urls mentioned in the tweet. */
79
+ urls: string[];
80
+ }
81
+
82
+ /**
83
+ * The details of a single media content included in a tweet.
84
+ *
85
+ * @public
86
+ */
87
+ export interface ITweetMedia {
88
+ /** The thumbnail URL for the video content of the tweet. */
89
+ thumbnailUrl?: string;
90
+
91
+ /** The type of media. */
92
+ type: EMediaType;
93
+
94
+ /** The direct URL to the media. */
95
+ url: string;
96
+ }
@@ -0,0 +1,48 @@
1
+ /**
2
+ * The details of a single user.
3
+ *
4
+ * @public
5
+ */
6
+ export interface IUser {
7
+ /** The creation date of user's account. */
8
+ createdAt: string;
9
+
10
+ /** The user's description. */
11
+ description?: string;
12
+
13
+ /** The number of followers of the user. */
14
+ followersCount: number;
15
+
16
+ /** The number of following of the user. */
17
+ followingsCount: number;
18
+
19
+ /** The full name of the user. */
20
+ fullName: string;
21
+
22
+ /** The rest id of the user. */
23
+ id: string;
24
+
25
+ /** Whether the account is verified or not. */
26
+ isVerified: boolean;
27
+
28
+ /** The number of tweets liked by the user. */
29
+ likeCount: number;
30
+
31
+ /** The location of user as provided by user. */
32
+ location?: string;
33
+
34
+ /** The rest id of the tweet pinned in the user's profile. */
35
+ pinnedTweet?: string;
36
+
37
+ /** The url of the profile banner image. */
38
+ profileBanner?: string;
39
+
40
+ /** The url of the profile image. */
41
+ profileImage: string;
42
+
43
+ /** The number of tweets made by the user. */
44
+ statusesCount: number;
45
+
46
+ /** The username/screenname of the user. */
47
+ userName: string;
48
+ }
@@ -0,0 +1,41 @@
1
+ /**
2
+ * Media to be sent as payload.
3
+ *
4
+ * @internal
5
+ */
6
+ export interface IMediaVariable {
7
+ /* eslint-disable @typescript-eslint/naming-convention */
8
+
9
+ media_entities: IMediaEntityVariable[];
10
+ possibly_sensitive: boolean;
11
+
12
+ /* eslint-enable @typescript-eslint/naming-convention */
13
+ }
14
+
15
+ /**
16
+ * Each media item in the media payload.
17
+ *
18
+ * @internal
19
+ */
20
+ export interface IMediaEntityVariable {
21
+ /* eslint-disable @typescript-eslint/naming-convention */
22
+
23
+ media_id: string;
24
+ tagged_users: string[];
25
+
26
+ /* eslint-enable @typescript-eslint/naming-convention */
27
+ }
28
+
29
+ /**
30
+ * Reply specific details to be sent in payload.
31
+ *
32
+ * @internal
33
+ */
34
+ export interface IReplyVariable {
35
+ /* eslint-disable @typescript-eslint/naming-convention */
36
+
37
+ exclude_reply_user_ids: string[];
38
+ in_reply_to_tweet_id: string;
39
+
40
+ /* eslint-enable @typescript-eslint/naming-convention */
41
+ }
@@ -0,0 +1,26 @@
1
+ /* eslint-disable */
2
+
3
+ /**
4
+ * Represents the raw data of the analytic result of the User.
5
+ *
6
+ * @public
7
+ */
8
+ export interface IAnalytics {
9
+ __typename: string;
10
+ organic_metrics_time_series: IAnalyticsMetric[];
11
+ id: string;
12
+ }
13
+
14
+ export interface IAnalyticsMetric {
15
+ metric_value: IAnalyticsMetricValue[];
16
+ timestamp: IAnalyticsTimeStamp;
17
+ }
18
+
19
+ export interface IAnalyticsMetricValue {
20
+ metric_value: number;
21
+ metric_type: string;
22
+ }
23
+
24
+ export interface IAnalyticsTimeStamp {
25
+ iso8601_time: string;
26
+ }
@@ -0,0 +1,13 @@
1
+ /* eslint-disable */
2
+
3
+ /**
4
+ * Represents a cursor object used for pagination.
5
+ *
6
+ * @public
7
+ */
8
+ export interface ICursor {
9
+ entryType: string;
10
+ __typename: string;
11
+ value: string;
12
+ cursorType: string;
13
+ }
@@ -0,0 +1,40 @@
1
+ /* eslint-disable */
2
+
3
+ import { ITweet } from './Tweet';
4
+
5
+ /**
6
+ * Represents the raw data of a single Tweet with limited visibility actions.
7
+ *
8
+ * @public
9
+ */
10
+ export interface ILimitedVisibilityTweet {
11
+ __typename: string;
12
+ tweet: ITweet;
13
+ limitedActionResults: ITweetLimitedActionResults;
14
+ }
15
+
16
+ export interface ITweetLimitedActionResults {
17
+ limited_actions: ITweetLimitedAction[];
18
+ }
19
+
20
+ export interface ITweetLimitedAction {
21
+ action: string;
22
+ prompt: ILimitedActionPrompt;
23
+ }
24
+
25
+ export interface ILimitedActionPrompt {
26
+ __typename: string;
27
+ cta_type: string;
28
+ headline: IPromptHeadline;
29
+ subtext: IPromptSubtext;
30
+ }
31
+
32
+ export interface IPromptHeadline {
33
+ text: string;
34
+ entities: any[];
35
+ }
36
+
37
+ export interface IPromptSubtext {
38
+ text: string;
39
+ entities: any[];
40
+ }
@@ -0,0 +1,50 @@
1
+ /* eslint-disable */
2
+
3
+ import { IDataResult } from '../composite/DataResult';
4
+ import { IUser } from './User';
5
+
6
+ /**
7
+ * Represents the raw data of a single List.
8
+ *
9
+ * @public
10
+ */
11
+ export interface IList {
12
+ created_at: number;
13
+ default_banner_media: IDefaultBannerMedia;
14
+ default_banner_media_results: IDefaultBannerMediaResults;
15
+ description: string;
16
+ following: boolean;
17
+ id: string;
18
+ id_str: string;
19
+ is_member: boolean;
20
+ member_count: number;
21
+ mode: string;
22
+ muting: boolean;
23
+ name: string;
24
+ subscriber_count: number;
25
+ user_results: IDataResult<IUser>;
26
+ facepile_urls: string[];
27
+ followers_context: string;
28
+ members_context: string;
29
+ }
30
+
31
+ export interface IDefaultBannerMedia {
32
+ media_info: IBannerMediaInfo;
33
+ }
34
+
35
+ export interface IDefaultBannerMediaResults {
36
+ result: IBannerMediaResult;
37
+ }
38
+
39
+ export interface IBannerMediaResult {
40
+ id: string;
41
+ media_key: string;
42
+ media_id: string;
43
+ media_info: IBannerMediaInfo;
44
+ }
45
+
46
+ export interface IBannerMediaInfo {
47
+ original_img_url: string;
48
+ original_img_width: number;
49
+ original_img_height: number;
50
+ }
@@ -0,0 +1,53 @@
1
+ /* eslint-disable */
2
+
3
+ import { ERawMediaType } from '../../../enums/raw/Media';
4
+
5
+ /**
6
+ * Represents the raw data of a single Media.
7
+ *
8
+ * @public
9
+ */
10
+ export interface IMedia {
11
+ display_url: string;
12
+ expanded_url: string;
13
+ id_str: string;
14
+ media_url_https: string;
15
+ type: ERawMediaType;
16
+ url: string;
17
+ }
18
+
19
+ export interface IExtendedMedia extends IMedia {
20
+ media_key: string;
21
+ ext_media_availability: IMediaAvailability;
22
+ additional_media_info?: IAdditionalMediaInfo;
23
+ mediaStats?: IMediaStats;
24
+ video_info?: IVideoInfo;
25
+ }
26
+
27
+ export interface IMediaAvailability {
28
+ status: string;
29
+ }
30
+
31
+ export interface IAdditionalMediaInfo {
32
+ monetizable: boolean;
33
+ }
34
+
35
+ export interface IMediaStats {
36
+ viewCount: number;
37
+ }
38
+
39
+ export interface IMediaAvailability {
40
+ status: string;
41
+ }
42
+
43
+ export interface IVideoInfo {
44
+ aspect_ratio: number[];
45
+ duration_millis: number;
46
+ variants: IVideoVariant[];
47
+ }
48
+
49
+ export interface IVideoVariant {
50
+ bitrate: number;
51
+ content_type: string;
52
+ url: string;
53
+ }