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.
- package/.eslintrc.js +2 -3
- package/.github/workflows/documentation.yml +1 -1
- package/.github/workflows/publish-alpha.yml +1 -1
- package/.github/workflows/publish.yml +1 -1
- package/.prettierignore +1 -1
- package/.tool-versions +1 -1
- package/README.md +100 -100
- package/dist/Rettiwt.d.ts +10 -3
- package/dist/Rettiwt.js +31 -12
- package/dist/Rettiwt.js.map +1 -1
- package/dist/cli.js +8 -11
- package/dist/cli.js.map +1 -1
- package/dist/collections/Extractors.d.ts +36 -2
- package/dist/collections/Extractors.js +41 -69
- package/dist/collections/Extractors.js.map +1 -1
- package/dist/collections/Groups.js +5 -1
- package/dist/collections/Groups.js.map +1 -1
- package/dist/collections/Requests.d.ts +3 -3
- package/dist/collections/Requests.js +41 -40
- package/dist/collections/Requests.js.map +1 -1
- package/dist/commands/List.js +21 -78
- package/dist/commands/List.js.map +1 -1
- package/dist/commands/Tweet.js +214 -373
- package/dist/commands/Tweet.js.map +1 -1
- package/dist/commands/User.js +138 -305
- package/dist/commands/User.js.map +1 -1
- package/dist/enums/Authentication.d.ts +10 -0
- package/dist/enums/Authentication.js +15 -0
- package/dist/enums/Authentication.js.map +1 -0
- package/dist/enums/Data.d.ts +3 -3
- package/dist/enums/Data.js +3 -3
- 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 +4 -0
- package/dist/enums/Resource.js +4 -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/CliUtils.js +1 -2
- package/dist/helper/CliUtils.js.map +1 -1
- package/dist/helper/JsonUtils.js +6 -11
- package/dist/helper/JsonUtils.js.map +1 -1
- 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 -5
- package/dist/index.js +26 -6
- 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 +16 -102
- package/dist/models/args/FetchArgs.js +105 -407
- package/dist/models/args/FetchArgs.js.map +1 -1
- package/dist/models/args/PostArgs.d.ts +16 -73
- package/dist/models/args/PostArgs.js +43 -236
- package/dist/models/args/PostArgs.js.map +1 -1
- package/dist/models/auth/AuthCookie.d.ts +21 -0
- package/dist/models/auth/AuthCookie.js +55 -0
- package/dist/models/auth/AuthCookie.js.map +1 -0
- package/dist/models/auth/AuthCredential.d.ts +30 -0
- package/dist/models/auth/AuthCredential.js +78 -0
- package/dist/models/auth/AuthCredential.js.map +1 -0
- package/dist/models/data/CursoredData.d.ts +5 -15
- package/dist/models/data/CursoredData.js +25 -32
- package/dist/models/data/CursoredData.js.map +1 -1
- package/dist/models/data/List.d.ts +7 -9
- package/dist/models/data/List.js +24 -4
- package/dist/models/data/List.js.map +1 -1
- package/dist/models/data/Notification.d.ts +10 -24
- package/dist/models/data/Notification.js +38 -36
- package/dist/models/data/Notification.js.map +1 -1
- package/dist/models/data/Tweet.d.ts +34 -31
- package/dist/models/data/Tweet.js +186 -112
- package/dist/models/data/Tweet.js.map +1 -1
- package/dist/models/data/User.d.ts +19 -23
- package/dist/models/data/User.js +92 -32
- package/dist/models/data/User.js.map +1 -1
- package/dist/models/errors/ApiError.js +8 -24
- package/dist/models/errors/ApiError.js.map +1 -1
- package/dist/models/errors/HttpError.js +8 -24
- package/dist/models/errors/HttpError.js.map +1 -1
- package/dist/models/errors/RettiwtError.d.ts +3 -2
- package/dist/models/errors/RettiwtError.js +8 -25
- package/dist/models/errors/RettiwtError.js.map +1 -1
- package/dist/models/errors/TimeoutError.js +5 -22
- package/dist/models/errors/TimeoutError.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 +60 -0
- package/dist/services/internal/AuthService.js +106 -0
- package/dist/services/internal/AuthService.js.map +1 -0
- package/dist/services/internal/ErrorService.js +38 -40
- package/dist/services/internal/ErrorService.js.map +1 -1
- package/dist/services/internal/LogService.d.ts +0 -6
- package/dist/services/internal/LogService.js +12 -32
- package/dist/services/internal/LogService.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 +22 -19
- package/dist/services/public/FetcherService.js +126 -153
- package/dist/services/public/FetcherService.js.map +1 -1
- package/dist/services/public/ListService.d.ts +2 -2
- package/dist/services/public/ListService.js +31 -100
- package/dist/services/public/ListService.js.map +1 -1
- package/dist/services/public/TweetService.d.ts +63 -10
- package/dist/services/public/TweetService.js +255 -387
- package/dist/services/public/TweetService.js.map +1 -1
- package/dist/services/public/UserService.d.ts +4 -4
- package/dist/services/public/UserService.js +199 -386
- package/dist/services/public/UserService.js.map +1 -1
- package/dist/types/RettiwtConfig.d.ts +17 -10
- package/dist/types/args/FetchArgs.d.ts +123 -0
- package/dist/types/{ReturnTypes.js → args/FetchArgs.js} +1 -1
- package/dist/types/args/FetchArgs.js.map +1 -0
- package/dist/types/args/PostArgs.d.ts +100 -0
- package/dist/types/args/PostArgs.js +3 -0
- package/dist/types/args/PostArgs.js.map +1 -0
- package/dist/types/auth/AuthCookie.d.ts +15 -0
- package/dist/types/auth/AuthCookie.js +3 -0
- package/dist/types/auth/AuthCookie.js.map +1 -0
- package/dist/types/auth/AuthCredential.d.ts +23 -0
- package/dist/types/auth/AuthCredential.js +3 -0
- package/dist/types/auth/AuthCredential.js.map +1 -0
- package/dist/types/auth/TidDynamicArgs.d.ts +10 -0
- package/dist/types/auth/TidDynamicArgs.js +3 -0
- package/dist/types/auth/TidDynamicArgs.js.map +1 -0
- package/dist/types/auth/TidHeader.d.ts +8 -0
- package/dist/types/auth/TidHeader.js +3 -0
- 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 +16 -0
- package/dist/types/data/CursoredData.js +3 -0
- package/dist/types/data/CursoredData.js.map +1 -0
- package/dist/types/data/List.d.ts +21 -0
- package/dist/types/data/List.js +3 -0
- package/dist/types/data/List.js.map +1 -0
- package/dist/types/data/Notification.d.ts +20 -0
- package/dist/types/data/Notification.js +3 -0
- package/dist/types/data/Notification.js.map +1 -0
- package/dist/types/data/Tweet.d.ts +71 -0
- package/dist/types/data/Tweet.js +3 -0
- package/dist/types/data/Tweet.js.map +1 -0
- package/dist/types/data/User.d.ts +35 -0
- package/dist/types/data/User.js +3 -0
- package/dist/types/data/User.js.map +1 -0
- 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/eslint.config.mjs +17 -0
- package/package.json +22 -19
- package/src/Rettiwt.ts +22 -7
- package/src/cli.ts +0 -2
- package/src/collections/Extractors.ts +40 -34
- package/src/collections/Groups.ts +4 -0
- package/src/collections/Requests.ts +46 -44
- package/src/commands/Tweet.ts +35 -7
- package/src/commands/User.ts +13 -2
- package/src/enums/Authentication.ts +10 -0
- package/src/enums/Data.ts +3 -3
- package/src/enums/Media.ts +10 -0
- package/src/enums/Notification.ts +12 -0
- package/src/enums/Resource.ts +4 -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/JsonUtils.ts +1 -1
- package/src/helper/TidUtils.ts +189 -0
- package/src/index.ts +78 -44
- package/src/models/RettiwtConfig.ts +64 -0
- package/src/models/args/FetchArgs.ts +86 -436
- package/src/models/args/PostArgs.ts +24 -249
- package/src/models/auth/AuthCookie.ts +58 -0
- package/src/models/auth/AuthCredential.ts +85 -0
- package/src/models/data/CursoredData.ts +21 -26
- package/src/models/data/List.ts +18 -15
- package/src/models/data/Notification.ts +25 -38
- package/src/models/data/Tweet.ts +143 -104
- package/src/models/data/User.ts +74 -44
- 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/{public → internal}/AuthService.ts +28 -60
- package/src/services/internal/LogService.ts +4 -19
- package/src/services/internal/TidService.ts +147 -0
- package/src/services/public/FetcherService.ts +89 -59
- package/src/services/public/ListService.ts +4 -4
- package/src/services/public/TweetService.ts +129 -42
- package/src/services/public/UserService.ts +49 -37
- package/src/types/RettiwtConfig.ts +18 -12
- package/src/types/args/FetchArgs.ts +148 -0
- package/src/types/args/PostArgs.ts +112 -0
- package/src/types/auth/AuthCookie.ts +22 -0
- package/src/types/auth/AuthCredential.ts +28 -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 +18 -0
- package/src/types/data/List.ts +27 -0
- package/src/types/data/Notification.ts +26 -0
- package/src/types/data/Tweet.ts +96 -0
- package/src/types/data/User.ts +48 -0
- 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/tsconfig.json +7 -5
- package/.eslintignore +0 -3
- package/dist/commands/Auth.d.ts +0 -10
- package/dist/commands/Auth.js +0 -101
- package/dist/commands/Auth.js.map +0 -1
- package/dist/models/errors/DataValidationError.d.ts +0 -30
- package/dist/models/errors/DataValidationError.js +0 -34
- package/dist/models/errors/DataValidationError.js.map +0 -1
- package/dist/services/public/AuthService.d.ts +0 -91
- package/dist/services/public/AuthService.js +0 -205
- package/dist/services/public/AuthService.js.map +0 -1
- package/dist/types/ReturnTypes.d.ts +0 -21
- package/dist/types/ReturnTypes.js.map +0 -1
- package/src/commands/Auth.ts +0 -46
- package/src/models/errors/DataValidationError.ts +0 -44
- package/src/types/ReturnTypes.ts +0 -24
|
@@ -1,118 +1,61 @@
|
|
|
1
|
-
import { NewTweet, NewTweetMedia } from 'rettiwt-core';
|
|
2
1
|
import { EResourceType } from '../../enums/Resource';
|
|
2
|
+
import { INewTweet, INewTweetMedia, IPostArgs, IUploadArgs } from '../../types/args/PostArgs';
|
|
3
3
|
/**
|
|
4
4
|
* Options specifying the data that is to be posted.
|
|
5
5
|
*
|
|
6
6
|
* @public
|
|
7
7
|
*/
|
|
8
|
-
export declare class PostArgs {
|
|
9
|
-
/**
|
|
10
|
-
* The id of the target resource.
|
|
11
|
-
*
|
|
12
|
-
* @remarks
|
|
13
|
-
* Required only when posting using the following resources:
|
|
14
|
-
* - {@link EResourceType.TWEET_LIKE}
|
|
15
|
-
* - {@link EResourceType.TWEET_RETWEET}
|
|
16
|
-
* - {@link EResourceType.TWEET_UNLIKE}
|
|
17
|
-
* - {@link EResourceType.TWEET_UNPOST}
|
|
18
|
-
* - {@link EResourceType.TWEET_UNRETWEET}
|
|
19
|
-
* - {@link EResourceType.USER_FOLLOW}
|
|
20
|
-
* - {@link EResourceType.USER_UNFOLLOW}
|
|
21
|
-
*/
|
|
8
|
+
export declare class PostArgs implements IPostArgs {
|
|
22
9
|
id?: string;
|
|
23
|
-
|
|
24
|
-
* The tweet that is to be posted.
|
|
25
|
-
*
|
|
26
|
-
* @remarks
|
|
27
|
-
* Required only when posting a tweet using {@link EResourceType.TWEET_POST}
|
|
28
|
-
*/
|
|
29
|
-
tweet?: TweetArgs;
|
|
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
|
-
*/
|
|
10
|
+
tweet?: NewTweet;
|
|
39
11
|
upload?: UploadArgs;
|
|
40
12
|
/**
|
|
41
13
|
* @param resource - The resource to be posted.
|
|
42
14
|
* @param args - Additional user-defined arguments for posting the resource.
|
|
43
15
|
*/
|
|
44
|
-
constructor(resource: EResourceType, args:
|
|
16
|
+
constructor(resource: EResourceType, args: IPostArgs);
|
|
45
17
|
}
|
|
46
18
|
/**
|
|
47
|
-
*
|
|
19
|
+
* Configuration for the new tweet to be posted.
|
|
48
20
|
*
|
|
49
21
|
* @public
|
|
50
22
|
*/
|
|
51
|
-
export declare class
|
|
52
|
-
|
|
53
|
-
* The list of media to be uploaded.
|
|
54
|
-
*
|
|
55
|
-
* @remarks
|
|
56
|
-
* Maximum number of media items that can be posted is 4.
|
|
57
|
-
*/
|
|
58
|
-
media?: TweetMediaArgs[];
|
|
59
|
-
/** The id of the tweet to quote. */
|
|
23
|
+
export declare class NewTweet implements INewTweet {
|
|
24
|
+
media?: NewTweetMedia[];
|
|
60
25
|
quote?: string;
|
|
61
|
-
/** The id of the tweet to which the given tweet must be a reply. */
|
|
62
26
|
replyTo?: string;
|
|
63
|
-
/** The date/time at which the tweet must be scheduled to be posted. */
|
|
64
27
|
scheduleFor?: Date;
|
|
65
|
-
/**
|
|
66
|
-
* The text for the tweet to be created.
|
|
67
|
-
*
|
|
68
|
-
* @remarks
|
|
69
|
-
* Length of the tweet must be \<= 280 characters.
|
|
70
|
-
*/
|
|
71
28
|
text: string;
|
|
72
29
|
/**
|
|
73
|
-
* @param
|
|
30
|
+
* @param newTweet - The args specifying the new tweet to be posted.
|
|
74
31
|
*/
|
|
75
|
-
constructor(
|
|
32
|
+
constructor(newTweet: INewTweet);
|
|
76
33
|
}
|
|
77
34
|
/**
|
|
78
|
-
*
|
|
35
|
+
* Configuration for the media to be uploaded.
|
|
79
36
|
*
|
|
80
37
|
* @public
|
|
81
38
|
*/
|
|
82
|
-
export declare class
|
|
83
|
-
/** The id of the media to post. */
|
|
39
|
+
export declare class NewTweetMedia implements INewTweetMedia {
|
|
84
40
|
id: string;
|
|
85
|
-
/**
|
|
86
|
-
* The list of id of the users tagged in the media.
|
|
87
|
-
*
|
|
88
|
-
* @remarks
|
|
89
|
-
* Maximum number of users that can be tagged is 10.
|
|
90
|
-
*/
|
|
91
41
|
tags?: string[];
|
|
92
42
|
/**
|
|
93
|
-
* @param
|
|
43
|
+
* @param newTweetMedia - The args specifying the new media to be posted along with the tweet.
|
|
94
44
|
*/
|
|
95
|
-
constructor(
|
|
45
|
+
constructor(newTweetMedia: INewTweetMedia);
|
|
96
46
|
}
|
|
97
47
|
/**
|
|
98
48
|
* Options specifying the media file to be uploaded.
|
|
99
49
|
*
|
|
100
|
-
* @
|
|
50
|
+
* @public
|
|
101
51
|
*/
|
|
102
|
-
export declare class UploadArgs {
|
|
103
|
-
/** The id allocated to the media file to be uploaded. */
|
|
52
|
+
export declare class UploadArgs implements IUploadArgs {
|
|
104
53
|
id?: string;
|
|
105
|
-
/** The media file to be uploaded. */
|
|
106
54
|
media?: string | ArrayBuffer;
|
|
107
|
-
/**
|
|
108
|
-
* The size (in bytes) of the media file to be uploaded.
|
|
109
|
-
*
|
|
110
|
-
* @remarks The size must be \<= 5242880 bytes.
|
|
111
|
-
*/
|
|
112
55
|
size?: number;
|
|
113
56
|
/**
|
|
114
57
|
* @param step - The upload step.
|
|
115
58
|
* @param args - The upload arguments for uploading the media file.
|
|
116
59
|
*/
|
|
117
|
-
constructor(step: EResourceType, args:
|
|
60
|
+
constructor(step: EResourceType, args: IUploadArgs);
|
|
118
61
|
}
|
|
@@ -1,277 +1,84 @@
|
|
|
1
1
|
"use strict";
|
|
2
|
-
var __extends = (this && this.__extends) || (function () {
|
|
3
|
-
var extendStatics = function (d, b) {
|
|
4
|
-
extendStatics = Object.setPrototypeOf ||
|
|
5
|
-
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
6
|
-
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
7
|
-
return extendStatics(d, b);
|
|
8
|
-
};
|
|
9
|
-
return function (d, b) {
|
|
10
|
-
if (typeof b !== "function" && b !== null)
|
|
11
|
-
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
12
|
-
extendStatics(d, b);
|
|
13
|
-
function __() { this.constructor = d; }
|
|
14
|
-
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
15
|
-
};
|
|
16
|
-
})();
|
|
17
|
-
var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) {
|
|
18
|
-
var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;
|
|
19
|
-
if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc);
|
|
20
|
-
else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;
|
|
21
|
-
return c > 3 && r && Object.defineProperty(target, key, r), r;
|
|
22
|
-
};
|
|
23
|
-
var __metadata = (this && this.__metadata) || function (k, v) {
|
|
24
|
-
if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v);
|
|
25
|
-
};
|
|
26
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
27
|
-
exports.UploadArgs = exports.
|
|
28
|
-
var class_validator_1 = require("class-validator");
|
|
29
|
-
var rettiwt_core_1 = require("rettiwt-core");
|
|
30
|
-
var Resource_1 = require("../../enums/Resource");
|
|
31
|
-
var DataValidationError_1 = require("../errors/DataValidationError");
|
|
3
|
+
exports.UploadArgs = exports.NewTweetMedia = exports.NewTweet = exports.PostArgs = void 0;
|
|
32
4
|
/**
|
|
33
5
|
* Options specifying the data that is to be posted.
|
|
34
6
|
*
|
|
35
7
|
* @public
|
|
36
8
|
*/
|
|
37
|
-
|
|
9
|
+
class PostArgs {
|
|
10
|
+
id;
|
|
11
|
+
tweet;
|
|
12
|
+
upload;
|
|
38
13
|
/**
|
|
39
14
|
* @param resource - The resource to be posted.
|
|
40
15
|
* @param args - Additional user-defined arguments for posting the resource.
|
|
41
16
|
*/
|
|
42
|
-
|
|
17
|
+
constructor(resource, args) {
|
|
43
18
|
this.id = args.id;
|
|
44
|
-
this.tweet = args.tweet ? new
|
|
19
|
+
this.tweet = args.tweet ? new NewTweet(args.tweet) : undefined;
|
|
45
20
|
this.upload = args.upload ? new UploadArgs(resource, args.upload) : undefined;
|
|
46
|
-
// Validating this object
|
|
47
|
-
var validationResult = (0, class_validator_1.validateSync)(this, { groups: [resource] });
|
|
48
|
-
// If valiation error occured
|
|
49
|
-
if (validationResult.length) {
|
|
50
|
-
throw new DataValidationError_1.DataValidationError(validationResult);
|
|
51
|
-
}
|
|
52
21
|
}
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
groups: [
|
|
56
|
-
Resource_1.EResourceType.MEDIA_UPLOAD_APPEND,
|
|
57
|
-
Resource_1.EResourceType.MEDIA_UPLOAD_FINALIZE,
|
|
58
|
-
Resource_1.EResourceType.MEDIA_UPLOAD_INITIALIZE,
|
|
59
|
-
Resource_1.EResourceType.TWEET_POST,
|
|
60
|
-
Resource_1.EResourceType.TWEET_SCHEDULE,
|
|
61
|
-
],
|
|
62
|
-
}),
|
|
63
|
-
(0, class_validator_1.IsNotEmpty)({
|
|
64
|
-
groups: [
|
|
65
|
-
Resource_1.EResourceType.TWEET_LIKE,
|
|
66
|
-
Resource_1.EResourceType.TWEET_RETWEET,
|
|
67
|
-
Resource_1.EResourceType.TWEET_UNLIKE,
|
|
68
|
-
Resource_1.EResourceType.TWEET_UNPOST,
|
|
69
|
-
Resource_1.EResourceType.TWEET_UNRETWEET,
|
|
70
|
-
Resource_1.EResourceType.TWEET_UNSCHEDULE,
|
|
71
|
-
Resource_1.EResourceType.USER_FOLLOW,
|
|
72
|
-
Resource_1.EResourceType.USER_UNFOLLOW,
|
|
73
|
-
],
|
|
74
|
-
}),
|
|
75
|
-
(0, class_validator_1.IsNumberString)(undefined, {
|
|
76
|
-
groups: [
|
|
77
|
-
Resource_1.EResourceType.TWEET_LIKE,
|
|
78
|
-
Resource_1.EResourceType.TWEET_RETWEET,
|
|
79
|
-
Resource_1.EResourceType.TWEET_UNLIKE,
|
|
80
|
-
Resource_1.EResourceType.TWEET_UNPOST,
|
|
81
|
-
Resource_1.EResourceType.TWEET_UNRETWEET,
|
|
82
|
-
Resource_1.EResourceType.TWEET_UNSCHEDULE,
|
|
83
|
-
Resource_1.EResourceType.USER_FOLLOW,
|
|
84
|
-
Resource_1.EResourceType.USER_UNFOLLOW,
|
|
85
|
-
],
|
|
86
|
-
}),
|
|
87
|
-
__metadata("design:type", String)
|
|
88
|
-
], PostArgs.prototype, "id", void 0);
|
|
89
|
-
__decorate([
|
|
90
|
-
(0, class_validator_1.IsEmpty)({
|
|
91
|
-
groups: [
|
|
92
|
-
Resource_1.EResourceType.MEDIA_UPLOAD_APPEND,
|
|
93
|
-
Resource_1.EResourceType.MEDIA_UPLOAD_FINALIZE,
|
|
94
|
-
Resource_1.EResourceType.MEDIA_UPLOAD_INITIALIZE,
|
|
95
|
-
Resource_1.EResourceType.TWEET_LIKE,
|
|
96
|
-
Resource_1.EResourceType.TWEET_RETWEET,
|
|
97
|
-
Resource_1.EResourceType.TWEET_UNLIKE,
|
|
98
|
-
Resource_1.EResourceType.TWEET_UNPOST,
|
|
99
|
-
Resource_1.EResourceType.TWEET_UNRETWEET,
|
|
100
|
-
Resource_1.EResourceType.TWEET_UNSCHEDULE,
|
|
101
|
-
Resource_1.EResourceType.USER_FOLLOW,
|
|
102
|
-
Resource_1.EResourceType.USER_UNFOLLOW,
|
|
103
|
-
],
|
|
104
|
-
}),
|
|
105
|
-
(0, class_validator_1.IsNotEmpty)({ groups: [Resource_1.EResourceType.TWEET_POST, Resource_1.EResourceType.TWEET_SCHEDULE] }),
|
|
106
|
-
(0, class_validator_1.IsObject)({ groups: [Resource_1.EResourceType.TWEET_POST, Resource_1.EResourceType.TWEET_SCHEDULE] }),
|
|
107
|
-
__metadata("design:type", TweetArgs)
|
|
108
|
-
], PostArgs.prototype, "tweet", void 0);
|
|
109
|
-
__decorate([
|
|
110
|
-
(0, class_validator_1.IsEmpty)({
|
|
111
|
-
groups: [
|
|
112
|
-
Resource_1.EResourceType.TWEET_LIKE,
|
|
113
|
-
Resource_1.EResourceType.TWEET_POST,
|
|
114
|
-
Resource_1.EResourceType.TWEET_RETWEET,
|
|
115
|
-
Resource_1.EResourceType.TWEET_SCHEDULE,
|
|
116
|
-
Resource_1.EResourceType.TWEET_UNLIKE,
|
|
117
|
-
Resource_1.EResourceType.TWEET_UNPOST,
|
|
118
|
-
Resource_1.EResourceType.TWEET_UNRETWEET,
|
|
119
|
-
Resource_1.EResourceType.TWEET_UNSCHEDULE,
|
|
120
|
-
Resource_1.EResourceType.USER_FOLLOW,
|
|
121
|
-
Resource_1.EResourceType.USER_UNFOLLOW,
|
|
122
|
-
],
|
|
123
|
-
}),
|
|
124
|
-
(0, class_validator_1.IsNotEmpty)({
|
|
125
|
-
groups: [
|
|
126
|
-
Resource_1.EResourceType.MEDIA_UPLOAD_INITIALIZE,
|
|
127
|
-
Resource_1.EResourceType.MEDIA_UPLOAD_APPEND,
|
|
128
|
-
Resource_1.EResourceType.MEDIA_UPLOAD_FINALIZE,
|
|
129
|
-
],
|
|
130
|
-
}),
|
|
131
|
-
(0, class_validator_1.IsObject)({
|
|
132
|
-
groups: [
|
|
133
|
-
Resource_1.EResourceType.MEDIA_UPLOAD_INITIALIZE,
|
|
134
|
-
Resource_1.EResourceType.MEDIA_UPLOAD_APPEND,
|
|
135
|
-
Resource_1.EResourceType.MEDIA_UPLOAD_FINALIZE,
|
|
136
|
-
],
|
|
137
|
-
}),
|
|
138
|
-
__metadata("design:type", UploadArgs)
|
|
139
|
-
], PostArgs.prototype, "upload", void 0);
|
|
140
|
-
return PostArgs;
|
|
141
|
-
}());
|
|
22
|
+
}
|
|
23
|
+
exports.PostArgs = PostArgs;
|
|
142
24
|
/**
|
|
143
|
-
*
|
|
25
|
+
* Configuration for the new tweet to be posted.
|
|
144
26
|
*
|
|
145
27
|
* @public
|
|
146
28
|
*/
|
|
147
|
-
|
|
148
|
-
|
|
29
|
+
class NewTweet {
|
|
30
|
+
media;
|
|
31
|
+
quote;
|
|
32
|
+
replyTo;
|
|
33
|
+
scheduleFor;
|
|
34
|
+
text;
|
|
149
35
|
/**
|
|
150
|
-
* @param
|
|
36
|
+
* @param newTweet - The args specifying the new tweet to be posted.
|
|
151
37
|
*/
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
_this.text = args.text;
|
|
159
|
-
// Validating this object
|
|
160
|
-
var validationResult = (0, class_validator_1.validateSync)(_this, { groups: [resource] });
|
|
161
|
-
// If valiation error occured
|
|
162
|
-
if (validationResult.length) {
|
|
163
|
-
throw new DataValidationError_1.DataValidationError(validationResult);
|
|
164
|
-
}
|
|
165
|
-
return _this;
|
|
38
|
+
constructor(newTweet) {
|
|
39
|
+
this.media = newTweet.media;
|
|
40
|
+
this.quote = newTweet.quote;
|
|
41
|
+
this.replyTo = newTweet.replyTo;
|
|
42
|
+
this.scheduleFor = newTweet.scheduleFor;
|
|
43
|
+
this.text = newTweet.text ?? '';
|
|
166
44
|
}
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
(0, class_validator_1.IsArray)({ groups: [Resource_1.EResourceType.TWEET_POST, Resource_1.EResourceType.TWEET_SCHEDULE] }),
|
|
170
|
-
(0, class_validator_1.ArrayMaxSize)(4, { groups: [Resource_1.EResourceType.TWEET_POST, Resource_1.EResourceType.TWEET_SCHEDULE] }),
|
|
171
|
-
(0, class_validator_1.IsObject)({ each: true, groups: [Resource_1.EResourceType.TWEET_POST, Resource_1.EResourceType.TWEET_SCHEDULE] }),
|
|
172
|
-
__metadata("design:type", Array)
|
|
173
|
-
], TweetArgs.prototype, "media", void 0);
|
|
174
|
-
__decorate([
|
|
175
|
-
(0, class_validator_1.IsOptional)({ groups: [Resource_1.EResourceType.TWEET_POST, Resource_1.EResourceType.TWEET_SCHEDULE] }),
|
|
176
|
-
(0, class_validator_1.IsNumberString)(undefined, { groups: [Resource_1.EResourceType.TWEET_POST, Resource_1.EResourceType.TWEET_SCHEDULE] }),
|
|
177
|
-
__metadata("design:type", String)
|
|
178
|
-
], TweetArgs.prototype, "quote", void 0);
|
|
179
|
-
__decorate([
|
|
180
|
-
(0, class_validator_1.IsOptional)({ groups: [Resource_1.EResourceType.TWEET_POST, Resource_1.EResourceType.TWEET_SCHEDULE] }),
|
|
181
|
-
(0, class_validator_1.IsNumberString)(undefined, { groups: [Resource_1.EResourceType.TWEET_POST, Resource_1.EResourceType.TWEET_SCHEDULE] }),
|
|
182
|
-
__metadata("design:type", String)
|
|
183
|
-
], TweetArgs.prototype, "replyTo", void 0);
|
|
184
|
-
__decorate([
|
|
185
|
-
(0, class_validator_1.IsEmpty)({ groups: [Resource_1.EResourceType.TWEET_POST] }),
|
|
186
|
-
(0, class_validator_1.IsNotEmpty)({ groups: [Resource_1.EResourceType.TWEET_SCHEDULE] }),
|
|
187
|
-
(0, class_validator_1.IsDate)({ groups: [Resource_1.EResourceType.TWEET_SCHEDULE] }),
|
|
188
|
-
(0, class_validator_1.MinDate)(function () { return new Date(); }, { groups: [Resource_1.EResourceType.TWEET_SCHEDULE] }),
|
|
189
|
-
__metadata("design:type", Date)
|
|
190
|
-
], TweetArgs.prototype, "scheduleFor", void 0);
|
|
191
|
-
__decorate([
|
|
192
|
-
(0, class_validator_1.IsNotEmpty)({ groups: [Resource_1.EResourceType.TWEET_POST, Resource_1.EResourceType.TWEET_SCHEDULE] }),
|
|
193
|
-
(0, class_validator_1.IsString)({ groups: [Resource_1.EResourceType.TWEET_POST, Resource_1.EResourceType.TWEET_SCHEDULE] }),
|
|
194
|
-
(0, class_validator_1.MaxLength)(280, { groups: [Resource_1.EResourceType.TWEET_POST, Resource_1.EResourceType.TWEET_SCHEDULE] }),
|
|
195
|
-
__metadata("design:type", String)
|
|
196
|
-
], TweetArgs.prototype, "text", void 0);
|
|
197
|
-
return TweetArgs;
|
|
198
|
-
}(rettiwt_core_1.NewTweet));
|
|
45
|
+
}
|
|
46
|
+
exports.NewTweet = NewTweet;
|
|
199
47
|
/**
|
|
200
|
-
*
|
|
48
|
+
* Configuration for the media to be uploaded.
|
|
201
49
|
*
|
|
202
50
|
* @public
|
|
203
51
|
*/
|
|
204
|
-
|
|
205
|
-
|
|
52
|
+
class NewTweetMedia {
|
|
53
|
+
id;
|
|
54
|
+
tags;
|
|
206
55
|
/**
|
|
207
|
-
* @param
|
|
56
|
+
* @param newTweetMedia - The args specifying the new media to be posted along with the tweet.
|
|
208
57
|
*/
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
_this = _super.call(this) || this;
|
|
213
|
-
_this.id = args.id;
|
|
214
|
-
_this.tags = (_a = args.tags) !== null && _a !== void 0 ? _a : [];
|
|
215
|
-
// Validating this object
|
|
216
|
-
var validationResult = (0, class_validator_1.validateSync)(_this);
|
|
217
|
-
// If validation error occured
|
|
218
|
-
if (validationResult.length) {
|
|
219
|
-
throw new DataValidationError_1.DataValidationError(validationResult);
|
|
220
|
-
}
|
|
221
|
-
return _this;
|
|
58
|
+
constructor(newTweetMedia) {
|
|
59
|
+
this.id = newTweetMedia.id;
|
|
60
|
+
this.tags = newTweetMedia.tags;
|
|
222
61
|
}
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
(0, class_validator_1.IsNumberString)(),
|
|
226
|
-
__metadata("design:type", String)
|
|
227
|
-
], TweetMediaArgs.prototype, "id", void 0);
|
|
228
|
-
__decorate([
|
|
229
|
-
(0, class_validator_1.IsOptional)(),
|
|
230
|
-
(0, class_validator_1.IsArray)(),
|
|
231
|
-
(0, class_validator_1.ArrayMaxSize)(10),
|
|
232
|
-
(0, class_validator_1.IsNumberString)(undefined, { each: true }),
|
|
233
|
-
__metadata("design:type", Array)
|
|
234
|
-
], TweetMediaArgs.prototype, "tags", void 0);
|
|
235
|
-
return TweetMediaArgs;
|
|
236
|
-
}(rettiwt_core_1.NewTweetMedia));
|
|
62
|
+
}
|
|
63
|
+
exports.NewTweetMedia = NewTweetMedia;
|
|
237
64
|
/**
|
|
238
65
|
* Options specifying the media file to be uploaded.
|
|
239
66
|
*
|
|
240
|
-
* @
|
|
67
|
+
* @public
|
|
241
68
|
*/
|
|
242
|
-
|
|
69
|
+
class UploadArgs {
|
|
70
|
+
id;
|
|
71
|
+
media;
|
|
72
|
+
size;
|
|
243
73
|
/**
|
|
244
74
|
* @param step - The upload step.
|
|
245
75
|
* @param args - The upload arguments for uploading the media file.
|
|
246
76
|
*/
|
|
247
|
-
|
|
77
|
+
constructor(step, args) {
|
|
248
78
|
this.size = args.size;
|
|
249
79
|
this.media = args.media;
|
|
250
80
|
this.id = args.id;
|
|
251
|
-
// Validating this object
|
|
252
|
-
var validationResult = (0, class_validator_1.validateSync)(this, { groups: [step] });
|
|
253
|
-
// If validation error occured
|
|
254
|
-
if (validationResult.length) {
|
|
255
|
-
throw new DataValidationError_1.DataValidationError(validationResult);
|
|
256
|
-
}
|
|
257
81
|
}
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
(0, class_validator_1.IsNotEmpty)({ groups: [Resource_1.EResourceType.MEDIA_UPLOAD_APPEND, Resource_1.EResourceType.MEDIA_UPLOAD_FINALIZE] }),
|
|
261
|
-
(0, class_validator_1.IsNumberString)(undefined, { groups: [Resource_1.EResourceType.MEDIA_UPLOAD_APPEND, Resource_1.EResourceType.MEDIA_UPLOAD_FINALIZE] }),
|
|
262
|
-
__metadata("design:type", String)
|
|
263
|
-
], UploadArgs.prototype, "id", void 0);
|
|
264
|
-
__decorate([
|
|
265
|
-
(0, class_validator_1.IsEmpty)({ groups: [Resource_1.EResourceType.MEDIA_UPLOAD_FINALIZE, Resource_1.EResourceType.MEDIA_UPLOAD_INITIALIZE] }),
|
|
266
|
-
(0, class_validator_1.IsNotEmpty)({ groups: [Resource_1.EResourceType.MEDIA_UPLOAD_APPEND] }),
|
|
267
|
-
__metadata("design:type", Object)
|
|
268
|
-
], UploadArgs.prototype, "media", void 0);
|
|
269
|
-
__decorate([
|
|
270
|
-
(0, class_validator_1.IsEmpty)({ groups: [Resource_1.EResourceType.MEDIA_UPLOAD_APPEND, Resource_1.EResourceType.MEDIA_UPLOAD_FINALIZE] }),
|
|
271
|
-
(0, class_validator_1.IsNotEmpty)({ groups: [Resource_1.EResourceType.MEDIA_UPLOAD_INITIALIZE] }),
|
|
272
|
-
(0, class_validator_1.Max)(5242880, { groups: [Resource_1.EResourceType.MEDIA_UPLOAD_INITIALIZE] }),
|
|
273
|
-
__metadata("design:type", Number)
|
|
274
|
-
], UploadArgs.prototype, "size", void 0);
|
|
275
|
-
return UploadArgs;
|
|
276
|
-
}());
|
|
82
|
+
}
|
|
83
|
+
exports.UploadArgs = UploadArgs;
|
|
277
84
|
//# sourceMappingURL=PostArgs.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"PostArgs.js","sourceRoot":"","sources":["../../../src/models/args/PostArgs.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"PostArgs.js","sourceRoot":"","sources":["../../../src/models/args/PostArgs.ts"],"names":[],"mappings":";;;AAGA;;;;GAIG;AACH,MAAa,QAAQ;IACb,EAAE,CAAU;IACZ,KAAK,CAAY;IACjB,MAAM,CAAc;IAE3B;;;OAGG;IACH,YAAmB,QAAuB,EAAE,IAAe;QAC1D,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;QAClB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,IAAI,QAAQ,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;QAC/D,IAAI,CAAC,MAAM,GAAG,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,IAAI,UAAU,CAAC,QAAQ,EAAE,IAAI,CAAC,MAAM,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC/E,CAAC;CACD;AAdD,4BAcC;AAED;;;;GAIG;AACH,MAAa,QAAQ;IACb,KAAK,CAAmB;IACxB,KAAK,CAAU;IACf,OAAO,CAAU;IACjB,WAAW,CAAQ;IACnB,IAAI,CAAS;IAEpB;;OAEG;IACH,YAAmB,QAAmB;QACrC,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC;QAC5B,IAAI,CAAC,KAAK,GAAG,QAAQ,CAAC,KAAK,CAAC;QAC5B,IAAI,CAAC,OAAO,GAAG,QAAQ,CAAC,OAAO,CAAC;QAChC,IAAI,CAAC,WAAW,GAAG,QAAQ,CAAC,WAAW,CAAC;QACxC,IAAI,CAAC,IAAI,GAAG,QAAQ,CAAC,IAAI,IAAI,EAAE,CAAC;IACjC,CAAC;CACD;AAjBD,4BAiBC;AAED;;;;GAIG;AACH,MAAa,aAAa;IAClB,EAAE,CAAS;IACX,IAAI,CAAY;IAEvB;;OAEG;IACH,YAAmB,aAA6B;QAC/C,IAAI,CAAC,EAAE,GAAG,aAAa,CAAC,EAAE,CAAC;QAC3B,IAAI,CAAC,IAAI,GAAG,aAAa,CAAC,IAAI,CAAC;IAChC,CAAC;CACD;AAXD,sCAWC;AAED;;;;GAIG;AACH,MAAa,UAAU;IACf,EAAE,CAAU;IACZ,KAAK,CAAwB;IAC7B,IAAI,CAAU;IAErB;;;OAGG;IACH,YAAmB,IAAmB,EAAE,IAAiB;QACxD,IAAI,CAAC,IAAI,GAAG,IAAI,CAAC,IAAI,CAAC;QACtB,IAAI,CAAC,KAAK,GAAG,IAAI,CAAC,KAAK,CAAC;QACxB,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,EAAE,CAAC;IACnB,CAAC;CACD;AAdD,gCAcC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { Cookie } from 'cookiejar';
|
|
2
|
+
import { IAuthCookie } from '../../types/auth/AuthCookie';
|
|
3
|
+
/**
|
|
4
|
+
* The cookie containing the tokens that are used to authenticate against Twitter.
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export declare class AuthCookie implements IAuthCookie {
|
|
9
|
+
auth_token: string;
|
|
10
|
+
ct0: string;
|
|
11
|
+
kdt: string;
|
|
12
|
+
twid: string;
|
|
13
|
+
/**
|
|
14
|
+
* @param cookies - The cookie list obtained from the browser.
|
|
15
|
+
*/
|
|
16
|
+
constructor(cookies: Cookie[]);
|
|
17
|
+
/**
|
|
18
|
+
* @returns the string representation of 'this' object.
|
|
19
|
+
*/
|
|
20
|
+
toString(): string;
|
|
21
|
+
}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.AuthCookie = void 0;
|
|
4
|
+
/**
|
|
5
|
+
* The cookie containing the tokens that are used to authenticate against Twitter.
|
|
6
|
+
*
|
|
7
|
+
* @public
|
|
8
|
+
*/
|
|
9
|
+
class AuthCookie {
|
|
10
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
11
|
+
auth_token;
|
|
12
|
+
ct0;
|
|
13
|
+
kdt;
|
|
14
|
+
twid;
|
|
15
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
16
|
+
/**
|
|
17
|
+
* @param cookies - The cookie list obtained from the browser.
|
|
18
|
+
*/
|
|
19
|
+
constructor(cookies) {
|
|
20
|
+
// Initializing defaults
|
|
21
|
+
this.auth_token = '';
|
|
22
|
+
this.ct0 = '';
|
|
23
|
+
this.kdt = '';
|
|
24
|
+
this.twid = '';
|
|
25
|
+
// Parsing the cookies
|
|
26
|
+
for (const cookie of cookies) {
|
|
27
|
+
if (cookie.name == 'kdt') {
|
|
28
|
+
this.kdt = cookie.value;
|
|
29
|
+
}
|
|
30
|
+
else if (cookie.name == 'twid') {
|
|
31
|
+
this.twid = cookie.value;
|
|
32
|
+
}
|
|
33
|
+
else if (cookie.name == 'ct0') {
|
|
34
|
+
this.ct0 = cookie.value;
|
|
35
|
+
}
|
|
36
|
+
else if (cookie.name == 'auth_token') {
|
|
37
|
+
this.auth_token = cookie.value;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* @returns the string representation of 'this' object.
|
|
43
|
+
*/
|
|
44
|
+
toString() {
|
|
45
|
+
/** The string representation of 'this' object. */
|
|
46
|
+
let outStr = '';
|
|
47
|
+
// Iterating through the (key, value) pairs of this cookie
|
|
48
|
+
for (const [key, value] of Object.entries(this)) {
|
|
49
|
+
outStr += `${key}=${value};`;
|
|
50
|
+
}
|
|
51
|
+
return outStr;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
exports.AuthCookie = AuthCookie;
|
|
55
|
+
//# sourceMappingURL=AuthCookie.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthCookie.js","sourceRoot":"","sources":["../../../src/models/auth/AuthCookie.ts"],"names":[],"mappings":";;;AAIA;;;;GAIG;AACH,MAAa,UAAU;IACtB,yDAAyD;IAElD,UAAU,CAAS;IACnB,GAAG,CAAS;IACZ,GAAG,CAAS;IACZ,IAAI,CAAS;IAEpB,wDAAwD;IAExD;;OAEG;IACH,YAAmB,OAAiB;QACnC,wBAAwB;QACxB,IAAI,CAAC,UAAU,GAAG,EAAE,CAAC;QACrB,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;QACd,IAAI,CAAC,GAAG,GAAG,EAAE,CAAC;QACd,IAAI,CAAC,IAAI,GAAG,EAAE,CAAC;QAEf,sBAAsB;QACtB,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE,CAAC;YAC9B,IAAI,MAAM,CAAC,IAAI,IAAI,KAAK,EAAE,CAAC;gBAC1B,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC;YACzB,CAAC;iBAAM,IAAI,MAAM,CAAC,IAAI,IAAI,MAAM,EAAE,CAAC;gBAClC,IAAI,CAAC,IAAI,GAAG,MAAM,CAAC,KAAK,CAAC;YAC1B,CAAC;iBAAM,IAAI,MAAM,CAAC,IAAI,IAAI,KAAK,EAAE,CAAC;gBACjC,IAAI,CAAC,GAAG,GAAG,MAAM,CAAC,KAAK,CAAC;YACzB,CAAC;iBAAM,IAAI,MAAM,CAAC,IAAI,IAAI,YAAY,EAAE,CAAC;gBACxC,IAAI,CAAC,UAAU,GAAG,MAAM,CAAC,KAAK,CAAC;YAChC,CAAC;QACF,CAAC;IACF,CAAC;IAED;;OAEG;IACI,QAAQ;QACd,kDAAkD;QAClD,IAAI,MAAM,GAAG,EAAE,CAAC;QAEhB,0DAA0D;QAC1D,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,CAAC;YACjD,MAAM,IAAI,GAAG,GAAG,IAAI,KAAe,GAAG,CAAC;QACxC,CAAC;QAED,OAAO,MAAM,CAAC;IACf,CAAC;CACD;AAhDD,gCAgDC"}
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { AxiosRequestHeaders } from 'axios';
|
|
2
|
+
import { Cookie } from 'cookiejar';
|
|
3
|
+
import { EAuthenticationType } from '../../enums/Authentication';
|
|
4
|
+
import { IAuthCredential } from '../../types/auth/AuthCredential';
|
|
5
|
+
/**
|
|
6
|
+
* The credentials for authenticating against Twitter.
|
|
7
|
+
*
|
|
8
|
+
* Depending on which tokens are present, the authentication type is determined as follows:
|
|
9
|
+
* - authToken, guestToken =\> Guest authentication.
|
|
10
|
+
* - authToken, csrfToken, cookie =\> User authentication.
|
|
11
|
+
* - authToken, guestToken, cookie =\> Guest authentication while logging in.
|
|
12
|
+
*
|
|
13
|
+
* @public
|
|
14
|
+
*/
|
|
15
|
+
export declare class AuthCredential implements IAuthCredential {
|
|
16
|
+
authToken?: string;
|
|
17
|
+
authenticationType?: EAuthenticationType;
|
|
18
|
+
cookies?: string;
|
|
19
|
+
csrfToken?: string;
|
|
20
|
+
guestToken?: string;
|
|
21
|
+
/**
|
|
22
|
+
* @param cookies - The list of cookies to be used for authenticating against Twitter.
|
|
23
|
+
* @param guestToken - The guest token to be used to authenticate a guest session.
|
|
24
|
+
*/
|
|
25
|
+
constructor(cookies?: Cookie[], guestToken?: string);
|
|
26
|
+
/**
|
|
27
|
+
* @returns The HTTP header representation of 'this' object.
|
|
28
|
+
*/
|
|
29
|
+
toHeader(): AxiosRequestHeaders;
|
|
30
|
+
}
|