rettiwt-api 5.0.0-alpha.1 → 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.
- package/dist/Rettiwt.d.ts +10 -3
- package/dist/Rettiwt.js +19 -7
- package/dist/Rettiwt.js.map +1 -1
- package/dist/collections/Extractors.d.ts +35 -2
- package/dist/collections/Extractors.js +3 -0
- package/dist/collections/Extractors.js.map +1 -1
- package/dist/collections/Groups.js +3 -0
- package/dist/collections/Groups.js.map +1 -1
- package/dist/collections/Requests.js +41 -41
- package/dist/collections/Requests.js.map +1 -1
- package/dist/commands/Tweet.js +33 -7
- package/dist/commands/Tweet.js.map +1 -1
- package/dist/commands/User.js +12 -2
- package/dist/commands/User.js.map +1 -1
- package/dist/enums/Authentication.d.ts +2 -10
- package/dist/enums/Authentication.js +3 -12
- package/dist/enums/Authentication.js.map +1 -1
- package/dist/enums/Data.d.ts +3 -15
- package/dist/enums/Data.js +4 -17
- package/dist/enums/Data.js.map +1 -1
- package/dist/enums/Media.d.ts +10 -0
- package/dist/enums/Media.js +15 -0
- package/dist/enums/Media.js.map +1 -0
- package/dist/enums/Notification.d.ts +12 -0
- package/dist/enums/Notification.js +17 -0
- package/dist/enums/Notification.js.map +1 -0
- package/dist/enums/Resource.d.ts +3 -0
- package/dist/enums/Resource.js +3 -0
- package/dist/enums/Resource.js.map +1 -1
- package/dist/enums/raw/Analytics.d.ts +28 -0
- package/dist/enums/raw/Analytics.js +34 -0
- package/dist/enums/raw/Analytics.js.map +1 -0
- package/dist/enums/raw/Media.d.ts +10 -0
- package/dist/enums/raw/Media.js +15 -0
- package/dist/enums/raw/Media.js.map +1 -0
- package/dist/enums/raw/Notification.d.ts +11 -0
- package/dist/enums/raw/Notification.js +16 -0
- package/dist/enums/raw/Notification.js.map +1 -0
- package/dist/enums/raw/Tweet.d.ts +9 -0
- package/dist/enums/raw/Tweet.js +14 -0
- package/dist/enums/raw/Tweet.js.map +1 -0
- package/dist/helper/TidUtils.d.ts +2 -0
- package/dist/helper/TidUtils.js +162 -0
- package/dist/helper/TidUtils.js.map +1 -0
- package/dist/index.d.ts +75 -4
- package/dist/index.js +26 -5
- package/dist/index.js.map +1 -1
- package/dist/models/RettiwtConfig.d.ts +28 -0
- package/dist/models/RettiwtConfig.js +55 -0
- package/dist/models/RettiwtConfig.js.map +1 -0
- package/dist/models/args/FetchArgs.d.ts +46 -3
- package/dist/models/args/FetchArgs.js +107 -5
- package/dist/models/args/FetchArgs.js.map +1 -1
- package/dist/models/args/PostArgs.d.ts +44 -16
- package/dist/models/args/PostArgs.js +61 -22
- package/dist/models/args/PostArgs.js.map +1 -1
- package/dist/models/auth/AuthCookie.d.ts +2 -0
- package/dist/models/auth/AuthCookie.js +2 -0
- package/dist/models/auth/AuthCookie.js.map +1 -1
- package/dist/models/auth/AuthCredential.d.ts +2 -0
- package/dist/models/auth/AuthCredential.js +2 -0
- package/dist/models/auth/AuthCredential.js.map +1 -1
- package/dist/models/data/CursoredData.d.ts +4 -13
- package/dist/models/data/CursoredData.js +16 -23
- package/dist/models/data/CursoredData.js.map +1 -1
- package/dist/models/data/List.d.ts +5 -1
- package/dist/models/data/List.js +14 -0
- package/dist/models/data/List.js.map +1 -1
- package/dist/models/data/Notification.d.ts +7 -5
- package/dist/models/data/Notification.js +19 -8
- package/dist/models/data/Notification.js.map +1 -1
- package/dist/models/data/Tweet.d.ts +29 -9
- package/dist/models/data/Tweet.js +103 -25
- package/dist/models/data/Tweet.js.map +1 -1
- package/dist/models/data/User.d.ts +17 -8
- package/dist/models/data/User.js +63 -13
- package/dist/models/data/User.js.map +1 -1
- package/dist/models/errors/RettiwtError.d.ts +3 -2
- package/dist/models/errors/RettiwtError.js +3 -2
- package/dist/models/errors/RettiwtError.js.map +1 -1
- package/dist/models/params/Variables.d.ts +41 -0
- package/dist/models/params/Variables.js +61 -0
- package/dist/models/params/Variables.js.map +1 -0
- package/dist/requests/List.d.ts +24 -0
- package/dist/requests/List.js +122 -0
- package/dist/requests/List.js.map +1 -0
- package/dist/requests/Media.d.ts +21 -0
- package/dist/requests/Media.js +70 -0
- package/dist/requests/Media.js.map +1 -0
- package/dist/requests/Tweet.d.ts +75 -0
- package/dist/requests/Tweet.js +480 -0
- package/dist/requests/Tweet.js.map +1 -0
- package/dist/requests/User.d.ts +111 -0
- package/dist/requests/User.js +762 -0
- package/dist/requests/User.js.map +1 -0
- package/dist/services/internal/AuthService.d.ts +3 -5
- package/dist/services/internal/AuthService.js +5 -8
- package/dist/services/internal/AuthService.js.map +1 -1
- package/dist/services/internal/TidService.d.ts +44 -0
- package/dist/services/internal/TidService.js +162 -0
- package/dist/services/internal/TidService.js.map +1 -0
- package/dist/services/public/FetcherService.d.ts +20 -19
- package/dist/services/public/FetcherService.js +67 -49
- package/dist/services/public/FetcherService.js.map +1 -1
- package/dist/services/public/ListService.d.ts +2 -2
- package/dist/services/public/ListService.js.map +1 -1
- package/dist/services/public/TweetService.d.ts +35 -7
- package/dist/services/public/TweetService.js +54 -8
- package/dist/services/public/TweetService.js.map +1 -1
- package/dist/services/public/UserService.d.ts +4 -4
- package/dist/services/public/UserService.js +25 -13
- package/dist/services/public/UserService.js.map +1 -1
- package/dist/types/RettiwtConfig.d.ts +9 -10
- package/dist/types/args/FetchArgs.d.ts +71 -7
- package/dist/types/args/PostArgs.d.ts +62 -18
- package/dist/types/auth/AuthCookie.d.ts +2 -0
- package/dist/types/auth/AuthCredential.d.ts +2 -0
- package/dist/types/auth/TidDynamicArgs.d.ts +10 -0
- package/dist/types/auth/{AccountCredential.js → TidDynamicArgs.js} +1 -1
- package/dist/types/auth/TidDynamicArgs.js.map +1 -0
- package/dist/types/auth/TidHeader.d.ts +8 -0
- package/dist/types/{ReturnTypes.js → auth/TidHeader.js} +1 -1
- package/dist/types/auth/TidHeader.js.map +1 -0
- package/dist/types/auth/TidParams.d.ts +27 -0
- package/dist/types/auth/TidParams.js +3 -0
- package/dist/types/auth/TidParams.js.map +1 -0
- package/dist/types/auth/TidProvider.d.ts +18 -0
- package/dist/types/auth/TidProvider.js +3 -0
- package/dist/types/auth/TidProvider.js.map +1 -0
- package/dist/types/data/CursoredData.d.ts +1 -10
- package/dist/types/data/Notification.d.ts +2 -2
- package/dist/types/data/Tweet.d.ts +2 -2
- package/dist/types/params/Variables.d.ts +27 -0
- package/dist/types/params/Variables.js +3 -0
- package/dist/types/params/Variables.js.map +1 -0
- package/dist/types/raw/base/Analytic.d.ts +21 -0
- package/dist/types/raw/base/Analytic.js +4 -0
- package/dist/types/raw/base/Analytic.js.map +1 -0
- package/dist/types/raw/base/Cursor.d.ts +11 -0
- package/dist/types/raw/base/Cursor.js +4 -0
- package/dist/types/raw/base/Cursor.js.map +1 -0
- package/dist/types/raw/base/LimitedVisibilityTweet.d.ts +32 -0
- package/dist/types/raw/base/LimitedVisibilityTweet.js +4 -0
- package/dist/types/raw/base/LimitedVisibilityTweet.js.map +1 -0
- package/dist/types/raw/base/List.d.ts +43 -0
- package/dist/types/raw/base/List.js +4 -0
- package/dist/types/raw/base/List.js.map +1 -0
- package/dist/types/raw/base/Media.d.ts +43 -0
- package/dist/types/raw/base/Media.js +4 -0
- package/dist/types/raw/base/Media.js.map +1 -0
- package/dist/types/raw/base/Notification.d.ts +53 -0
- package/dist/types/raw/base/Notification.js +4 -0
- package/dist/types/raw/base/Notification.js.map +1 -0
- package/dist/types/raw/base/Space.d.ts +32 -0
- package/dist/types/raw/base/Space.js +4 -0
- package/dist/types/raw/base/Space.js.map +1 -0
- package/dist/types/raw/base/Tweet.d.ts +119 -0
- package/dist/types/raw/base/Tweet.js +4 -0
- package/dist/types/raw/base/Tweet.js.map +1 -0
- package/dist/types/raw/base/User.d.ts +140 -0
- package/dist/types/raw/base/User.js +4 -0
- package/dist/types/raw/base/User.js.map +1 -0
- package/dist/types/raw/composite/DataResult.d.ts +8 -0
- package/dist/types/raw/composite/DataResult.js +3 -0
- package/dist/types/raw/composite/DataResult.js.map +1 -0
- package/dist/types/raw/composite/TimelineTweet.d.ts +11 -0
- package/dist/types/raw/composite/TimelineTweet.js +4 -0
- package/dist/types/raw/composite/TimelineTweet.js.map +1 -0
- package/dist/types/raw/composite/TimelineUser.d.ts +10 -0
- package/dist/types/raw/composite/TimelineUser.js +4 -0
- package/dist/types/raw/composite/TimelineUser.js.map +1 -0
- package/dist/types/raw/generic/Error.d.ts +30 -0
- package/dist/types/raw/generic/Error.js +3 -0
- package/dist/types/raw/generic/Error.js.map +1 -0
- package/dist/types/raw/generic/Response.d.ts +12 -0
- package/dist/types/raw/generic/Response.js +3 -0
- package/dist/types/raw/generic/Response.js.map +1 -0
- package/dist/types/raw/list/Details.d.ts +122 -0
- package/dist/types/raw/list/Details.js +4 -0
- package/dist/types/raw/list/Details.js.map +1 -0
- package/dist/types/raw/list/Members.d.ts +134 -0
- package/dist/types/raw/list/Members.js +4 -0
- package/dist/types/raw/list/Members.js.map +1 -0
- package/dist/types/raw/list/Tweets.d.ts +1968 -0
- package/dist/types/raw/list/Tweets.js +4 -0
- package/dist/types/raw/list/Tweets.js.map +1 -0
- package/dist/types/raw/media/FinalizeUpload.d.ts +18 -0
- package/dist/types/raw/media/FinalizeUpload.js +4 -0
- package/dist/types/raw/media/FinalizeUpload.js.map +1 -0
- package/dist/types/raw/media/InitalizeUpload.d.ts +10 -0
- package/dist/types/raw/media/InitalizeUpload.js +4 -0
- package/dist/types/raw/media/InitalizeUpload.js.map +1 -0
- package/dist/types/raw/media/LiveVideoStream.d.ts +19 -0
- package/dist/types/raw/media/LiveVideoStream.js +4 -0
- package/dist/types/raw/media/LiveVideoStream.js.map +1 -0
- package/dist/types/raw/space/Details.d.ts +315 -0
- package/dist/types/raw/space/Details.js +4 -0
- package/dist/types/raw/space/Details.js.map +1 -0
- package/dist/types/raw/tweet/Details.d.ts +183 -0
- package/dist/types/raw/tweet/Details.js +4 -0
- package/dist/types/raw/tweet/Details.js.map +1 -0
- package/dist/types/raw/tweet/Like.d.ts +12 -0
- package/dist/types/raw/tweet/Like.js +4 -0
- package/dist/types/raw/tweet/Like.js.map +1 -0
- package/dist/types/raw/tweet/Likers.d.ts +170 -0
- package/dist/types/raw/tweet/Likers.js +4 -0
- package/dist/types/raw/tweet/Likers.js.map +1 -0
- package/dist/types/raw/tweet/Post.d.ts +133 -0
- package/dist/types/raw/tweet/Post.js +4 -0
- package/dist/types/raw/tweet/Post.js.map +1 -0
- package/dist/types/raw/tweet/Replies.d.ts +465 -0
- package/dist/types/raw/tweet/Replies.js +4 -0
- package/dist/types/raw/tweet/Replies.js.map +1 -0
- package/dist/types/raw/tweet/Retweet.d.ts +25 -0
- package/dist/types/raw/tweet/Retweet.js +4 -0
- package/dist/types/raw/tweet/Retweet.js.map +1 -0
- package/dist/types/raw/tweet/Retweeters.d.ts +177 -0
- package/dist/types/raw/tweet/Retweeters.js +4 -0
- package/dist/types/raw/tweet/Retweeters.js.map +1 -0
- package/dist/types/raw/tweet/Schedule.d.ts +15 -0
- package/dist/types/raw/tweet/Schedule.js +4 -0
- package/dist/types/raw/tweet/Schedule.js.map +1 -0
- package/dist/types/raw/tweet/Search.d.ts +518 -0
- package/dist/types/raw/tweet/Search.js +4 -0
- package/dist/types/raw/tweet/Search.js.map +1 -0
- package/dist/types/raw/tweet/Unlike.d.ts +12 -0
- package/dist/types/raw/tweet/Unlike.js +4 -0
- package/dist/types/raw/tweet/Unlike.js.map +1 -0
- package/dist/types/raw/tweet/Unpost.d.ts +17 -0
- package/dist/types/raw/tweet/Unpost.js +4 -0
- package/dist/types/raw/tweet/Unpost.js.map +1 -0
- package/dist/types/raw/tweet/Unretweet.d.ts +25 -0
- package/dist/types/raw/tweet/Unretweet.js +4 -0
- package/dist/types/raw/tweet/Unretweet.js.map +1 -0
- package/dist/types/raw/tweet/Unschedule.d.ts +12 -0
- package/dist/types/raw/tweet/Unschedule.js +4 -0
- package/dist/types/raw/tweet/Unschedule.js.map +1 -0
- package/dist/types/raw/user/Affiliates.d.ts +154 -0
- package/dist/types/raw/user/Affiliates.js +4 -0
- package/dist/types/raw/user/Affiliates.js.map +1 -0
- package/dist/types/raw/user/Analytics.d.ts +32 -0
- package/dist/types/raw/user/Analytics.js +4 -0
- package/dist/types/raw/user/Analytics.js.map +1 -0
- package/dist/types/raw/user/Bookmarks.d.ts +550 -0
- package/dist/types/raw/user/Bookmarks.js +4 -0
- package/dist/types/raw/user/Bookmarks.js.map +1 -0
- package/dist/types/raw/user/Details.d.ts +157 -0
- package/dist/types/raw/user/Details.js +4 -0
- package/dist/types/raw/user/Details.js.map +1 -0
- package/dist/types/raw/user/Follow.d.ts +248 -0
- package/dist/types/raw/user/Follow.js +4 -0
- package/dist/types/raw/user/Follow.js.map +1 -0
- package/dist/types/raw/user/Followed.d.ts +1666 -0
- package/dist/types/raw/user/Followed.js +4 -0
- package/dist/types/raw/user/Followed.js.map +1 -0
- package/dist/types/raw/user/Followers.d.ts +182 -0
- package/dist/types/raw/user/Followers.js +4 -0
- package/dist/types/raw/user/Followers.js.map +1 -0
- package/dist/types/raw/user/Following.d.ts +182 -0
- package/dist/types/raw/user/Following.js +4 -0
- package/dist/types/raw/user/Following.js.map +1 -0
- package/dist/types/raw/user/Highlights.d.ts +1106 -0
- package/dist/types/raw/user/Highlights.js +4 -0
- package/dist/types/raw/user/Highlights.js.map +1 -0
- package/dist/types/raw/user/Likes.d.ts +1065 -0
- package/dist/types/raw/user/Likes.js +4 -0
- package/dist/types/raw/user/Likes.js.map +1 -0
- package/dist/types/raw/user/Media.d.ts +1492 -0
- package/dist/types/raw/user/Media.js +4 -0
- package/dist/types/raw/user/Media.js.map +1 -0
- package/dist/types/raw/user/Notifications.d.ts +142 -0
- package/dist/types/raw/user/Notifications.js +4 -0
- package/dist/types/raw/user/Notifications.js.map +1 -0
- package/dist/types/raw/user/Recommended.d.ts +1991 -0
- package/dist/types/raw/user/Recommended.js +4 -0
- package/dist/types/raw/user/Recommended.js.map +1 -0
- package/dist/types/raw/user/Scheduled.d.ts +31 -0
- package/dist/types/raw/user/Scheduled.js +4 -0
- package/dist/types/raw/user/Scheduled.js.map +1 -0
- package/dist/types/raw/user/Subscriptions.d.ts +151 -0
- package/dist/types/raw/user/Subscriptions.js +4 -0
- package/dist/types/raw/user/Subscriptions.js.map +1 -0
- package/dist/types/raw/user/Tweets.d.ts +1065 -0
- package/dist/types/raw/user/Tweets.js +4 -0
- package/dist/types/raw/user/Tweets.js.map +1 -0
- package/dist/types/raw/user/TweetsAndReplies.d.ts +1065 -0
- package/dist/types/raw/user/TweetsAndReplies.js +4 -0
- package/dist/types/raw/user/TweetsAndReplies.js.map +1 -0
- package/dist/types/raw/user/Unfollow.d.ts +248 -0
- package/dist/types/raw/user/Unfollow.js +4 -0
- package/dist/types/raw/user/Unfollow.js.map +1 -0
- package/package.json +3 -3
- package/src/Rettiwt.ts +22 -7
- package/src/collections/Extractors.ts +38 -34
- package/src/collections/Groups.ts +3 -0
- package/src/collections/Requests.ts +43 -42
- package/src/commands/Tweet.ts +35 -7
- package/src/commands/User.ts +13 -2
- package/src/enums/Authentication.ts +2 -11
- package/src/enums/Data.ts +3 -16
- package/src/enums/Media.ts +10 -0
- package/src/enums/Notification.ts +12 -0
- package/src/enums/Resource.ts +3 -0
- package/src/enums/raw/Analytics.ts +29 -0
- package/src/enums/raw/Media.ts +10 -0
- package/src/enums/raw/Notification.ts +11 -0
- package/src/enums/raw/Tweet.ts +9 -0
- package/src/helper/TidUtils.ts +189 -0
- package/src/index.ts +78 -43
- package/src/models/RettiwtConfig.ts +64 -0
- package/src/models/args/FetchArgs.ts +121 -5
- package/src/models/args/PostArgs.ts +61 -21
- package/src/models/auth/AuthCookie.ts +2 -0
- package/src/models/auth/AuthCredential.ts +2 -0
- package/src/models/data/CursoredData.ts +16 -24
- package/src/models/data/List.ts +16 -2
- package/src/models/data/Notification.ts +21 -12
- package/src/models/data/Tweet.ts +120 -39
- package/src/models/data/User.ts +71 -15
- package/src/models/errors/RettiwtError.ts +3 -2
- package/src/models/params/Variables.ts +62 -0
- package/src/requests/List.ts +121 -0
- package/src/requests/Media.ts +67 -0
- package/src/requests/Tweet.ts +496 -0
- package/src/requests/User.ts +783 -0
- package/src/services/internal/AuthService.ts +6 -11
- package/src/services/internal/TidService.ts +147 -0
- package/src/services/public/FetcherService.ts +78 -58
- package/src/services/public/ListService.ts +4 -4
- package/src/services/public/TweetService.ts +87 -40
- package/src/services/public/UserService.ts +47 -35
- package/src/types/RettiwtConfig.ts +11 -12
- package/src/types/args/FetchArgs.ts +92 -8
- package/src/types/args/PostArgs.ts +72 -22
- package/src/types/auth/AuthCookie.ts +2 -0
- package/src/types/auth/AuthCredential.ts +2 -0
- package/src/types/auth/TidDynamicArgs.ts +10 -0
- package/src/types/auth/TidHeader.ts +12 -0
- package/src/types/auth/TidParams.ts +36 -0
- package/src/types/auth/TidProvider.ts +19 -0
- package/src/types/data/CursoredData.ts +1 -11
- package/src/types/data/Notification.ts +2 -2
- package/src/types/data/Tweet.ts +2 -2
- package/src/types/params/Variables.ts +41 -0
- package/src/types/raw/base/Analytic.ts +26 -0
- package/src/types/raw/base/Cursor.ts +13 -0
- package/src/types/raw/base/LimitedVisibilityTweet.ts +40 -0
- package/src/types/raw/base/List.ts +50 -0
- package/src/types/raw/base/Media.ts +53 -0
- package/src/types/raw/base/Notification.ts +67 -0
- package/src/types/raw/base/Space.ts +35 -0
- package/src/types/raw/base/Tweet.ts +139 -0
- package/src/types/raw/base/User.ts +164 -0
- package/src/types/raw/composite/DataResult.ts +8 -0
- package/src/types/raw/composite/TimelineTweet.ts +14 -0
- package/src/types/raw/composite/TimelineUser.ts +13 -0
- package/src/types/raw/generic/Error.ts +35 -0
- package/src/types/raw/generic/Response.ts +13 -0
- package/src/types/raw/list/Details.ts +137 -0
- package/src/types/raw/list/Members.ts +154 -0
- package/src/types/raw/list/Tweets.ts +2296 -0
- package/src/types/raw/media/FinalizeUpload.ts +20 -0
- package/src/types/raw/media/InitalizeUpload.ts +12 -0
- package/src/types/raw/media/LiveVideoStream.ts +21 -0
- package/src/types/raw/space/Details.ts +359 -0
- package/src/types/raw/tweet/Details.ts +210 -0
- package/src/types/raw/tweet/Like.ts +14 -0
- package/src/types/raw/tweet/Likers.ts +200 -0
- package/src/types/raw/tweet/Post.ts +150 -0
- package/src/types/raw/tweet/Replies.ts +539 -0
- package/src/types/raw/tweet/Retweet.ts +31 -0
- package/src/types/raw/tweet/Retweeters.ts +208 -0
- package/src/types/raw/tweet/Schedule.ts +18 -0
- package/src/types/raw/tweet/Search.ts +597 -0
- package/src/types/raw/tweet/Unlike.ts +14 -0
- package/src/types/raw/tweet/Unpost.ts +20 -0
- package/src/types/raw/tweet/Unretweet.ts +31 -0
- package/src/types/raw/tweet/Unschedule.ts +14 -0
- package/src/types/raw/user/Affiliates.ts +179 -0
- package/src/types/raw/user/Analytics.ts +39 -0
- package/src/types/raw/user/Bookmarks.ts +637 -0
- package/src/types/raw/user/Details.ts +185 -0
- package/src/types/raw/user/Follow.ts +280 -0
- package/src/types/raw/user/Followed.ts +1942 -0
- package/src/types/raw/user/Followers.ts +215 -0
- package/src/types/raw/user/Following.ts +215 -0
- package/src/types/raw/user/Highlights.ts +1287 -0
- package/src/types/raw/user/Likes.ts +1254 -0
- package/src/types/raw/user/Media.ts +1738 -0
- package/src/types/raw/user/Notifications.ts +175 -0
- package/src/types/raw/user/Recommended.ts +2319 -0
- package/src/types/raw/user/Scheduled.ts +37 -0
- package/src/types/raw/user/Subscriptions.ts +176 -0
- package/src/types/raw/user/Tweets.ts +1254 -0
- package/src/types/raw/user/TweetsAndReplies.ts +1254 -0
- package/src/types/raw/user/Unfollow.ts +280 -0
- package/dist/models/auth/AccountCredential.d.ts +0 -13
- package/dist/models/auth/AccountCredential.js +0 -21
- package/dist/models/auth/AccountCredential.js.map +0 -1
- package/dist/types/ReturnTypes.d.ts +0 -21
- package/dist/types/ReturnTypes.js.map +0 -1
- package/dist/types/auth/AccountCredential.d.ts +0 -11
- package/dist/types/auth/AccountCredential.js.map +0 -1
- package/src/models/auth/AccountCredential.ts +0 -19
- package/src/types/ReturnTypes.ts +0 -24
- package/src/types/auth/AccountCredential.ts +0 -13
|
@@ -1,28 +1,25 @@
|
|
|
1
|
-
import {
|
|
2
|
-
IUserBookmarksResponse,
|
|
3
|
-
IUserDetailsResponse,
|
|
4
|
-
IUserFollowedResponse,
|
|
5
|
-
IUserFollowersResponse,
|
|
6
|
-
IUserFollowingResponse,
|
|
7
|
-
IUserFollowResponse,
|
|
8
|
-
IUserHighlightsResponse,
|
|
9
|
-
IUserLikesResponse,
|
|
10
|
-
IUserMediaResponse,
|
|
11
|
-
IUserNotificationsResponse,
|
|
12
|
-
IUserRecommendedResponse,
|
|
13
|
-
IUserSubscriptionsResponse,
|
|
14
|
-
IUserTweetsAndRepliesResponse,
|
|
15
|
-
IUserTweetsResponse,
|
|
16
|
-
IUserUnfollowResponse,
|
|
17
|
-
} from 'rettiwt-core';
|
|
18
|
-
|
|
19
1
|
import { extractors } from '../../collections/Extractors';
|
|
20
2
|
import { EResourceType } from '../../enums/Resource';
|
|
21
3
|
import { CursoredData } from '../../models/data/CursoredData';
|
|
22
4
|
import { Notification } from '../../models/data/Notification';
|
|
23
5
|
import { Tweet } from '../../models/data/Tweet';
|
|
24
6
|
import { User } from '../../models/data/User';
|
|
25
|
-
import {
|
|
7
|
+
import { RettiwtConfig } from '../../models/RettiwtConfig';
|
|
8
|
+
import { IUserBookmarksResponse } from '../../types/raw/user/Bookmarks';
|
|
9
|
+
import { IUserDetailsResponse } from '../../types/raw/user/Details';
|
|
10
|
+
import { IUserFollowResponse } from '../../types/raw/user/Follow';
|
|
11
|
+
import { IUserFollowedResponse } from '../../types/raw/user/Followed';
|
|
12
|
+
import { IUserFollowersResponse } from '../../types/raw/user/Followers';
|
|
13
|
+
import { IUserFollowingResponse } from '../../types/raw/user/Following';
|
|
14
|
+
import { IUserHighlightsResponse } from '../../types/raw/user/Highlights';
|
|
15
|
+
import { IUserLikesResponse } from '../../types/raw/user/Likes';
|
|
16
|
+
import { IUserMediaResponse } from '../../types/raw/user/Media';
|
|
17
|
+
import { IUserNotificationsResponse } from '../../types/raw/user/Notifications';
|
|
18
|
+
import { IUserRecommendedResponse } from '../../types/raw/user/Recommended';
|
|
19
|
+
import { IUserSubscriptionsResponse } from '../../types/raw/user/Subscriptions';
|
|
20
|
+
import { IUserTweetsResponse } from '../../types/raw/user/Tweets';
|
|
21
|
+
import { IUserTweetsAndRepliesResponse } from '../../types/raw/user/TweetsAndReplies';
|
|
22
|
+
import { IUserUnfollowResponse } from '../../types/raw/user/Unfollow';
|
|
26
23
|
|
|
27
24
|
import { FetcherService } from './FetcherService';
|
|
28
25
|
|
|
@@ -37,7 +34,7 @@ export class UserService extends FetcherService {
|
|
|
37
34
|
*
|
|
38
35
|
* @internal
|
|
39
36
|
*/
|
|
40
|
-
public constructor(config
|
|
37
|
+
public constructor(config: RettiwtConfig) {
|
|
41
38
|
super(config);
|
|
42
39
|
}
|
|
43
40
|
|
|
@@ -84,7 +81,7 @@ export class UserService extends FetcherService {
|
|
|
84
81
|
/**
|
|
85
82
|
* Get the details of a user.
|
|
86
83
|
*
|
|
87
|
-
* @param id - The username/id of the target user.
|
|
84
|
+
* @param id - The username/id(s) of the target user/users.
|
|
88
85
|
*
|
|
89
86
|
* @returns
|
|
90
87
|
* The details of the given user.
|
|
@@ -126,25 +123,40 @@ export class UserService extends FetcherService {
|
|
|
126
123
|
* });
|
|
127
124
|
* ```
|
|
128
125
|
*/
|
|
129
|
-
public async details(id:
|
|
126
|
+
public async details<T extends string | string[]>(id: T): Promise<T extends string ? User | undefined : User[]> {
|
|
130
127
|
let resource: EResourceType;
|
|
131
128
|
|
|
132
|
-
// If
|
|
133
|
-
if (
|
|
134
|
-
resource = EResourceType.
|
|
129
|
+
// If details of multiple users required
|
|
130
|
+
if (Array.isArray(id)) {
|
|
131
|
+
resource = EResourceType.USER_DETAILS_BY_IDS_BULK;
|
|
132
|
+
|
|
133
|
+
// Fetching raw details
|
|
134
|
+
const response = await this.request<IUserDetailsResponse>(resource, { ids: id });
|
|
135
|
+
|
|
136
|
+
// Deserializing response
|
|
137
|
+
const data = extractors[resource](response, id);
|
|
138
|
+
|
|
139
|
+
return data as T extends string ? User | undefined : User[];
|
|
135
140
|
}
|
|
136
|
-
// If
|
|
141
|
+
// If details of single user required
|
|
137
142
|
else {
|
|
138
|
-
|
|
139
|
-
|
|
143
|
+
// If username is given
|
|
144
|
+
if (isNaN(Number(id))) {
|
|
145
|
+
resource = EResourceType.USER_DETAILS_BY_USERNAME;
|
|
146
|
+
}
|
|
147
|
+
// If id is given
|
|
148
|
+
else {
|
|
149
|
+
resource = EResourceType.USER_DETAILS_BY_ID;
|
|
150
|
+
}
|
|
140
151
|
|
|
141
|
-
|
|
142
|
-
|
|
152
|
+
// Fetching raw details
|
|
153
|
+
const response = await this.request<IUserDetailsResponse>(resource, { id: id });
|
|
143
154
|
|
|
144
|
-
|
|
145
|
-
|
|
155
|
+
// Deserializing response
|
|
156
|
+
const data = extractors[resource](response);
|
|
146
157
|
|
|
147
|
-
|
|
158
|
+
return data as T extends string ? User | undefined : User[];
|
|
159
|
+
}
|
|
148
160
|
}
|
|
149
161
|
|
|
150
162
|
/**
|
|
@@ -381,7 +393,7 @@ export class UserService extends FetcherService {
|
|
|
381
393
|
|
|
382
394
|
// Fetching raw list of likes
|
|
383
395
|
const response = await this.request<IUserLikesResponse>(resource, {
|
|
384
|
-
id: this.userId,
|
|
396
|
+
id: this.config.userId,
|
|
385
397
|
count: count,
|
|
386
398
|
cursor: cursor,
|
|
387
399
|
});
|
|
@@ -502,7 +514,7 @@ export class UserService extends FetcherService {
|
|
|
502
514
|
first = false;
|
|
503
515
|
}
|
|
504
516
|
|
|
505
|
-
cursor = notifications.next
|
|
517
|
+
cursor = notifications.next;
|
|
506
518
|
}
|
|
507
519
|
}
|
|
508
520
|
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { ITidProvider } from './auth/TidProvider';
|
|
1
2
|
import { IErrorHandler } from './ErrorHandler';
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -9,9 +10,6 @@ export interface IRettiwtConfig {
|
|
|
9
10
|
/** The apiKey (cookie) to use for authenticating Rettiwt against Twitter API. */
|
|
10
11
|
apiKey?: string;
|
|
11
12
|
|
|
12
|
-
/** The guestKey (guest token) to use for guest access to Twitter API. */
|
|
13
|
-
guestKey?: string;
|
|
14
|
-
|
|
15
13
|
/**
|
|
16
14
|
* Optional URL to proxy server to use for requests to Twitter API.
|
|
17
15
|
*
|
|
@@ -19,15 +17,6 @@ export interface IRettiwtConfig {
|
|
|
19
17
|
*/
|
|
20
18
|
proxyUrl?: URL;
|
|
21
19
|
|
|
22
|
-
/**
|
|
23
|
-
* Optional URL to proxy server to use for authentication against Twitter API.
|
|
24
|
-
*
|
|
25
|
-
* @remarks Required when deploying to cloud platforms to bypass Error 429.
|
|
26
|
-
*
|
|
27
|
-
* @defaultValue Same as {@link IRettiwtConfig.proxyUrl}
|
|
28
|
-
*/
|
|
29
|
-
authProxyUrl?: URL;
|
|
30
|
-
|
|
31
20
|
/** The max wait time (in milli-seconds) for a response; if not set, Twitter server timeout is used. */
|
|
32
21
|
timeout?: number;
|
|
33
22
|
|
|
@@ -37,10 +26,20 @@ export interface IRettiwtConfig {
|
|
|
37
26
|
/** Optional custom error handler to define error conditions and process API/HTTP errors in responses. */
|
|
38
27
|
errorHandler?: IErrorHandler;
|
|
39
28
|
|
|
29
|
+
/** Optional custom `x-client-transaction-id` header provider. */
|
|
30
|
+
tidProvider?: ITidProvider;
|
|
31
|
+
|
|
40
32
|
/**
|
|
41
33
|
* Optional custom HTTP headers to add to all requests to Twitter API.
|
|
42
34
|
*
|
|
43
35
|
* @remarks Custom headers can be useful for proxies, avoiding rate limits, etc.
|
|
44
36
|
*/
|
|
45
37
|
headers?: { [key: string]: string };
|
|
38
|
+
|
|
39
|
+
/**
|
|
40
|
+
* The delay (in ms) to use between concurrent request.
|
|
41
|
+
*
|
|
42
|
+
* Can either be a number or a function that returns a number synchronously or asynchronously.
|
|
43
|
+
*/
|
|
44
|
+
delay?: number | (() => number | Promise<number>);
|
|
46
45
|
}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { ESearchResultType, ITweetFilter } from 'rettiwt-core';
|
|
2
|
-
|
|
3
1
|
/**
|
|
4
2
|
* Options specifying the data that is to be fetched.
|
|
5
3
|
*
|
|
@@ -51,14 +49,100 @@ export interface IFetchArgs {
|
|
|
51
49
|
id?: string;
|
|
52
50
|
|
|
53
51
|
/**
|
|
54
|
-
* The
|
|
55
|
-
*
|
|
56
|
-
*
|
|
52
|
+
* The IDs of the target resources.
|
|
53
|
+
*
|
|
54
|
+
* @remarks
|
|
55
|
+
* - Required only for {@link EResourceType.TWEET_DETAILS_BULK} and {@link EResourceType.USER_DETAILS_BY_IDS_BULK}.
|
|
56
|
+
*/
|
|
57
|
+
ids?: string[];
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
/**
|
|
61
|
+
* The filter to be used for searching tweets.
|
|
62
|
+
*
|
|
63
|
+
* @public
|
|
64
|
+
*/
|
|
65
|
+
export interface ITweetFilter {
|
|
66
|
+
/** The date upto which tweets are to be searched. */
|
|
67
|
+
endDate?: Date;
|
|
68
|
+
|
|
69
|
+
/** The list of words to exclude from search. */
|
|
70
|
+
excludeWords?: string[];
|
|
71
|
+
|
|
72
|
+
/**
|
|
73
|
+
* The list of usernames whose tweets are to be searched.
|
|
74
|
+
*
|
|
75
|
+
* @remarks
|
|
76
|
+
* '\@' must be excluded from the username!
|
|
77
|
+
*/
|
|
78
|
+
fromUsers?: string[];
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* The list of hashtags to search.
|
|
82
|
+
*
|
|
83
|
+
* @remarks
|
|
84
|
+
* '#' must be excluded from the hashtag!
|
|
85
|
+
*/
|
|
86
|
+
hashtags?: string[];
|
|
87
|
+
|
|
88
|
+
/** The exact phrase to search. */
|
|
89
|
+
includePhrase?: string;
|
|
90
|
+
|
|
91
|
+
/** The list of words to search. */
|
|
92
|
+
includeWords?: string[];
|
|
93
|
+
|
|
94
|
+
/** The language of the tweets to search. */
|
|
95
|
+
language?: string;
|
|
96
|
+
|
|
97
|
+
/** Whether to fetch tweets that are links or not. */
|
|
98
|
+
links?: boolean;
|
|
99
|
+
|
|
100
|
+
/** The list from which tweets are to be searched. */
|
|
101
|
+
list?: string;
|
|
102
|
+
|
|
103
|
+
/** The id of the tweet, before which the tweets are to be searched. */
|
|
104
|
+
maxId?: string;
|
|
105
|
+
|
|
106
|
+
/**
|
|
107
|
+
* The list of username mentioned in the tweets to search.
|
|
57
108
|
*
|
|
58
|
-
* @
|
|
109
|
+
* @remarks
|
|
110
|
+
* '\@' must be excluded from the username!
|
|
111
|
+
*/
|
|
112
|
+
mentions?: string[];
|
|
113
|
+
|
|
114
|
+
/** The minimun number of likes to search by. */
|
|
115
|
+
minLikes?: number;
|
|
116
|
+
|
|
117
|
+
/** The minimum number of replies to search by. */
|
|
118
|
+
minReplies?: number;
|
|
119
|
+
|
|
120
|
+
/** The minimum number of retweets to search by. */
|
|
121
|
+
minRetweets?: number;
|
|
122
|
+
|
|
123
|
+
/** The optional words to search. */
|
|
124
|
+
optionalWords?: string[];
|
|
125
|
+
|
|
126
|
+
/** The id of the tweet which is quoted in the tweets to search. */
|
|
127
|
+
quoted?: string;
|
|
128
|
+
|
|
129
|
+
/** Whether to fetch tweets that are replies or not. */
|
|
130
|
+
replies?: boolean;
|
|
131
|
+
|
|
132
|
+
/** The id of the tweet, after which the tweets are to be searched. */
|
|
133
|
+
sinceId?: string;
|
|
134
|
+
|
|
135
|
+
/** The date starting from which tweets are to be searched. */
|
|
136
|
+
startDate?: Date;
|
|
137
|
+
|
|
138
|
+
/**
|
|
139
|
+
* The list of username to whom the tweets to be searched, are adressed.
|
|
59
140
|
*
|
|
60
141
|
* @remarks
|
|
61
|
-
*
|
|
142
|
+
* '\@' must be excluded from the username!
|
|
62
143
|
*/
|
|
63
|
-
|
|
144
|
+
toUsers?: string[];
|
|
145
|
+
|
|
146
|
+
/** Whether to fetch top tweets or not. */
|
|
147
|
+
top?: boolean;
|
|
64
148
|
}
|
|
@@ -1,25 +1,3 @@
|
|
|
1
|
-
import { INewTweet } from 'rettiwt-core';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* Options specifying the media file to be uploaded.
|
|
5
|
-
*
|
|
6
|
-
* @public
|
|
7
|
-
*/
|
|
8
|
-
export interface IUploadArgs {
|
|
9
|
-
/** The id allocated to the media file to be uploaded. */
|
|
10
|
-
id?: string;
|
|
11
|
-
|
|
12
|
-
/** The media file to be uploaded. */
|
|
13
|
-
media?: string | ArrayBuffer;
|
|
14
|
-
|
|
15
|
-
/**
|
|
16
|
-
* The size (in bytes) of the media file to be uploaded.
|
|
17
|
-
*
|
|
18
|
-
* @remarks The size must be \<= 5242880 bytes.
|
|
19
|
-
*/
|
|
20
|
-
size?: number;
|
|
21
|
-
}
|
|
22
|
-
|
|
23
1
|
/**
|
|
24
2
|
* Options specifying the data that is to be posted.
|
|
25
3
|
*
|
|
@@ -60,3 +38,75 @@ export interface IPostArgs {
|
|
|
60
38
|
*/
|
|
61
39
|
upload?: IUploadArgs;
|
|
62
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
|
+
}
|
|
@@ -7,6 +7,8 @@ import { EAuthenticationType } from '../../enums/Authentication';
|
|
|
7
7
|
* - authToken, guestToken =\> Guest authentication.
|
|
8
8
|
* - authToken, csrfToken, cookie =\> User authentication.
|
|
9
9
|
* - authToken, guestToken, cookie =\> Guest authentication while logging in.
|
|
10
|
+
*
|
|
11
|
+
* @public
|
|
10
12
|
*/
|
|
11
13
|
export interface IAuthCredential {
|
|
12
14
|
/** The bearer token from twitter.com. */
|
|
@@ -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
|
+
}
|
|
@@ -14,15 +14,5 @@ export interface ICursoredData<T extends INotification | ITweet | IUser> {
|
|
|
14
14
|
list: T[];
|
|
15
15
|
|
|
16
16
|
/** The cursor to the next batch of data. */
|
|
17
|
-
next:
|
|
18
|
-
}
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* The cursor to the batch of data to fetch.
|
|
22
|
-
*
|
|
23
|
-
* @public
|
|
24
|
-
*/
|
|
25
|
-
export interface ICursor {
|
|
26
|
-
/** The cursor string. */
|
|
27
|
-
value: string;
|
|
17
|
+
next: string;
|
|
28
18
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { ENotificationType } from '../../enums/
|
|
1
|
+
import { ENotificationType } from '../../enums/Notification';
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* The details of a single notification.
|
|
@@ -16,7 +16,7 @@ export interface INotification {
|
|
|
16
16
|
message: string;
|
|
17
17
|
|
|
18
18
|
/** The date/time at which the notification was received. */
|
|
19
|
-
receivedAt:
|
|
19
|
+
receivedAt: string;
|
|
20
20
|
|
|
21
21
|
/** The list of id of the target tweet(s) of the notification. */
|
|
22
22
|
target: string[];
|
package/src/types/data/Tweet.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { EMediaType } from '
|
|
1
|
+
import { EMediaType } from '../../enums/Media';
|
|
2
2
|
|
|
3
3
|
import { IUser } from './User';
|
|
4
4
|
|
|
@@ -14,7 +14,7 @@ export interface ITweet {
|
|
|
14
14
|
/** The ID of tweet which started the current conversation. */
|
|
15
15
|
conversationId: string;
|
|
16
16
|
|
|
17
|
-
/** The date
|
|
17
|
+
/** The creation date of the tweet. */
|
|
18
18
|
createdAt: string;
|
|
19
19
|
|
|
20
20
|
/** Additional tweet entities like urls, mentions, etc. */
|
|
@@ -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,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
|
+
}
|