rettiwt-api 4.2.0 → 5.0.0-alpha.1
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 +1 -1
- package/dist/Rettiwt.js +15 -8
- 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 +1 -0
- package/dist/collections/Extractors.js +38 -69
- package/dist/collections/Extractors.js.map +1 -1
- package/dist/collections/Groups.js +2 -1
- package/dist/collections/Groups.js.map +1 -1
- package/dist/collections/Requests.d.ts +3 -3
- package/dist/collections/Requests.js +36 -35
- 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 +185 -370
- package/dist/commands/Tweet.js.map +1 -1
- package/dist/commands/User.js +129 -306
- package/dist/commands/User.js.map +1 -1
- package/dist/enums/Authentication.d.ts +18 -0
- package/dist/enums/Authentication.js +24 -0
- package/dist/enums/Authentication.js.map +1 -0
- package/dist/enums/Data.d.ts +12 -0
- package/dist/enums/Data.js +14 -1
- package/dist/enums/Data.js.map +1 -1
- package/dist/enums/Resource.d.ts +1 -0
- package/dist/enums/Resource.js +1 -0
- package/dist/enums/Resource.js.map +1 -1
- 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/index.d.ts +1 -2
- package/dist/index.js +1 -2
- package/dist/index.js.map +1 -1
- package/dist/models/args/FetchArgs.d.ts +4 -133
- package/dist/models/args/FetchArgs.js +12 -416
- package/dist/models/args/FetchArgs.js.map +1 -1
- package/dist/models/args/PostArgs.d.ts +16 -101
- package/dist/models/args/PostArgs.js +26 -258
- package/dist/models/args/PostArgs.js.map +1 -1
- package/dist/models/auth/AccountCredential.d.ts +13 -0
- package/dist/models/auth/AccountCredential.js +21 -0
- package/dist/models/auth/AccountCredential.js.map +1 -0
- package/dist/models/auth/AuthCookie.d.ts +19 -0
- package/dist/models/auth/AuthCookie.js +53 -0
- package/dist/models/auth/AuthCookie.js.map +1 -0
- package/dist/models/auth/AuthCredential.d.ts +28 -0
- package/dist/models/auth/AuthCredential.js +76 -0
- package/dist/models/auth/AuthCredential.js.map +1 -0
- package/dist/models/data/CursoredData.d.ts +3 -4
- package/dist/models/data/CursoredData.js +19 -19
- package/dist/models/data/CursoredData.js.map +1 -1
- package/dist/models/data/List.d.ts +2 -8
- package/dist/models/data/List.js +10 -4
- package/dist/models/data/List.js.map +1 -1
- package/dist/models/data/Notification.d.ts +5 -21
- package/dist/models/data/Notification.js +24 -33
- package/dist/models/data/Notification.js.map +1 -1
- package/dist/models/data/Tweet.d.ts +4 -17
- package/dist/models/data/Tweet.js +83 -73
- package/dist/models/data/Tweet.js.map +1 -1
- package/dist/models/data/User.d.ts +2 -15
- package/dist/models/data/User.js +33 -23
- 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.js +5 -23
- 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/services/{public → internal}/AuthService.d.ts +5 -34
- package/dist/services/internal/AuthService.js +109 -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/public/FetcherService.d.ts +5 -3
- package/dist/services/public/FetcherService.js +96 -141
- package/dist/services/public/FetcherService.js.map +1 -1
- package/dist/services/public/ListService.js +31 -100
- package/dist/services/public/ListService.js.map +1 -1
- package/dist/services/public/TweetService.d.ts +29 -4
- package/dist/services/public/TweetService.js +208 -386
- package/dist/services/public/TweetService.js.map +1 -1
- package/dist/services/public/UserService.js +186 -385
- package/dist/services/public/UserService.js.map +1 -1
- package/dist/types/RettiwtConfig.d.ts +8 -0
- package/dist/types/args/FetchArgs.d.ts +59 -0
- package/dist/types/args/FetchArgs.js +3 -0
- package/dist/types/args/FetchArgs.js.map +1 -0
- package/dist/types/args/PostArgs.d.ts +56 -0
- package/dist/types/args/PostArgs.js +3 -0
- package/dist/types/args/PostArgs.js.map +1 -0
- package/dist/types/auth/AccountCredential.d.ts +11 -0
- package/dist/types/auth/AccountCredential.js +3 -0
- package/dist/types/auth/AccountCredential.js.map +1 -0
- package/dist/types/auth/AuthCookie.d.ts +13 -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 +21 -0
- package/dist/types/auth/AuthCredential.js +3 -0
- package/dist/types/auth/AuthCredential.js.map +1 -0
- package/dist/types/data/CursoredData.d.ts +25 -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/eslint.config.mjs +17 -0
- package/package.json +22 -19
- package/src/Rettiwt.ts +1 -1
- package/src/cli.ts +0 -2
- package/src/collections/Extractors.ts +2 -0
- package/src/collections/Groups.ts +1 -0
- package/src/collections/Requests.ts +37 -36
- package/src/enums/Authentication.ts +19 -0
- package/src/enums/Data.ts +13 -0
- package/src/enums/Resource.ts +1 -0
- package/src/helper/JsonUtils.ts +1 -1
- package/src/index.ts +1 -2
- package/src/models/args/FetchArgs.ts +4 -470
- package/src/models/args/PostArgs.ts +20 -285
- package/src/models/auth/AccountCredential.ts +19 -0
- package/src/models/auth/AuthCookie.ts +56 -0
- package/src/models/auth/AuthCredential.ts +83 -0
- package/src/models/data/CursoredData.ts +12 -9
- package/src/models/data/List.ts +3 -14
- package/src/models/data/Notification.ts +6 -28
- package/src/models/data/Tweet.ts +17 -43
- package/src/models/data/User.ts +5 -31
- package/src/services/{public → internal}/AuthService.ts +28 -55
- package/src/services/internal/LogService.ts +4 -19
- package/src/services/public/FetcherService.ts +18 -8
- package/src/services/public/TweetService.ts +44 -4
- package/src/services/public/UserService.ts +2 -2
- package/src/types/RettiwtConfig.ts +7 -0
- package/src/types/args/FetchArgs.ts +64 -0
- package/src/types/args/PostArgs.ts +62 -0
- package/src/types/auth/AccountCredential.ts +13 -0
- package/src/types/auth/AuthCookie.ts +20 -0
- package/src/types/auth/AuthCredential.ts +26 -0
- package/src/types/data/CursoredData.ts +28 -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/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.js +0 -205
- package/dist/services/public/AuthService.js.map +0 -1
- package/src/commands/Auth.ts +0 -46
- package/src/models/errors/DataValidationError.ts +0 -44
|
@@ -1,27 +1,45 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.TweetMedia = exports.TweetEntities = exports.Tweet = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
4
|
+
const rettiwt_core_1 = require("rettiwt-core");
|
|
5
|
+
const Logging_1 = require("../../enums/Logging");
|
|
6
|
+
const JsonUtils_1 = require("../../helper/JsonUtils");
|
|
7
|
+
const LogService_1 = require("../../services/internal/LogService");
|
|
8
|
+
const User_1 = require("./User");
|
|
9
9
|
/**
|
|
10
10
|
* The details of a single tweet.
|
|
11
11
|
*
|
|
12
12
|
* @public
|
|
13
13
|
*/
|
|
14
|
-
|
|
14
|
+
class Tweet {
|
|
15
|
+
bookmarkCount;
|
|
16
|
+
conversationId;
|
|
17
|
+
createdAt;
|
|
18
|
+
entities;
|
|
19
|
+
fullText;
|
|
20
|
+
id;
|
|
21
|
+
lang;
|
|
22
|
+
likeCount;
|
|
23
|
+
media;
|
|
24
|
+
quoteCount;
|
|
25
|
+
quoted;
|
|
26
|
+
replyCount;
|
|
27
|
+
replyTo;
|
|
28
|
+
retweetCount;
|
|
29
|
+
retweetedTweet;
|
|
30
|
+
tweetBy;
|
|
31
|
+
url;
|
|
32
|
+
viewCount;
|
|
15
33
|
/**
|
|
16
34
|
* @param tweet - The raw tweet details.
|
|
17
35
|
*/
|
|
18
|
-
|
|
19
|
-
var _a, _b;
|
|
36
|
+
constructor(tweet) {
|
|
20
37
|
this.id = tweet.rest_id;
|
|
38
|
+
this.conversationId = tweet.legacy.conversation_id_str;
|
|
21
39
|
this.createdAt = tweet.legacy.created_at;
|
|
22
40
|
this.tweetBy = new User_1.User(tweet.core.user_results.result);
|
|
23
41
|
this.entities = new TweetEntities(tweet.legacy.entities);
|
|
24
|
-
this.media =
|
|
42
|
+
this.media = tweet.legacy.extended_entities?.media?.map((media) => new TweetMedia(media));
|
|
25
43
|
this.quoted = this.getQuotedTweet(tweet);
|
|
26
44
|
this.fullText = tweet.note_tweet ? tweet.note_tweet.note_tweet_results.result.text : tweet.legacy.full_text;
|
|
27
45
|
this.replyTo = tweet.legacy.in_reply_to_status_id_str;
|
|
@@ -33,6 +51,7 @@ var Tweet = /** @class */ (function () {
|
|
|
33
51
|
this.viewCount = tweet.views.count ? parseInt(tweet.views.count) : 0;
|
|
34
52
|
this.bookmarkCount = tweet.legacy.bookmark_count;
|
|
35
53
|
this.retweetedTweet = this.getRetweetedTweet(tweet);
|
|
54
|
+
this.url = `https://x.com/${this.tweetBy.userName}/status/${this.id}`;
|
|
36
55
|
}
|
|
37
56
|
/**
|
|
38
57
|
* Extract and deserialize the original quoted tweet from the given raw tweet.
|
|
@@ -41,23 +60,22 @@ var Tweet = /** @class */ (function () {
|
|
|
41
60
|
*
|
|
42
61
|
* @returns - The deserialized original quoted tweet.
|
|
43
62
|
*/
|
|
44
|
-
|
|
45
|
-
var _a, _b, _c, _d, _e, _f;
|
|
63
|
+
getQuotedTweet(tweet) {
|
|
46
64
|
// If tweet with limited visibility
|
|
47
65
|
if (tweet.quoted_status_result &&
|
|
48
|
-
|
|
49
|
-
|
|
66
|
+
tweet.quoted_status_result?.result?.__typename == 'TweetWithVisibilityResults' &&
|
|
67
|
+
tweet.quoted_status_result.result?.tweet?.legacy) {
|
|
50
68
|
return new Tweet(tweet.quoted_status_result.result.tweet);
|
|
51
69
|
}
|
|
52
70
|
// If normal tweet
|
|
53
|
-
else if (
|
|
71
|
+
else if (tweet.quoted_status_result?.result?.rest_id) {
|
|
54
72
|
return new Tweet(tweet.quoted_status_result.result);
|
|
55
73
|
}
|
|
56
74
|
// Else, skip
|
|
57
75
|
else {
|
|
58
76
|
return undefined;
|
|
59
77
|
}
|
|
60
|
-
}
|
|
78
|
+
}
|
|
61
79
|
/**
|
|
62
80
|
* Extract and deserialize the original retweeted tweet from the given raw tweet.
|
|
63
81
|
*
|
|
@@ -65,23 +83,22 @@ var Tweet = /** @class */ (function () {
|
|
|
65
83
|
*
|
|
66
84
|
* @returns - The deserialized original retweeted tweet.
|
|
67
85
|
*/
|
|
68
|
-
|
|
69
|
-
var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l;
|
|
86
|
+
getRetweetedTweet(tweet) {
|
|
70
87
|
// If retweet with limited visibility
|
|
71
|
-
if (
|
|
72
|
-
|
|
73
|
-
|
|
88
|
+
if (tweet.legacy?.retweeted_status_result &&
|
|
89
|
+
tweet.legacy?.retweeted_status_result?.result?.__typename == 'TweetWithVisibilityResults' &&
|
|
90
|
+
tweet.legacy?.retweeted_status_result?.result?.tweet?.legacy) {
|
|
74
91
|
return new Tweet(tweet.legacy.retweeted_status_result.result.tweet);
|
|
75
92
|
}
|
|
76
93
|
// If normal tweet
|
|
77
|
-
else if (
|
|
94
|
+
else if (tweet.legacy?.retweeted_status_result?.result?.rest_id) {
|
|
78
95
|
return new Tweet(tweet.legacy.retweeted_status_result.result);
|
|
79
96
|
}
|
|
80
97
|
// Else, skip
|
|
81
98
|
else {
|
|
82
99
|
return undefined;
|
|
83
100
|
}
|
|
84
|
-
}
|
|
101
|
+
}
|
|
85
102
|
/**
|
|
86
103
|
* Extracts and deserializes the list of tweets from the given raw response data.
|
|
87
104
|
*
|
|
@@ -91,22 +108,20 @@ var Tweet = /** @class */ (function () {
|
|
|
91
108
|
*
|
|
92
109
|
* @internal
|
|
93
110
|
*/
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
var tweets = [];
|
|
111
|
+
static list(response) {
|
|
112
|
+
const tweets = [];
|
|
97
113
|
// Extracting the matching data
|
|
98
|
-
|
|
114
|
+
const extract = (0, JsonUtils_1.findByFilter)(response, '__typename', 'TimelineTweet');
|
|
99
115
|
// Deserializing valid data
|
|
100
|
-
for (
|
|
101
|
-
var item = extract_1[_i];
|
|
116
|
+
for (const item of extract) {
|
|
102
117
|
// If tweet with limited visibility
|
|
103
|
-
if (
|
|
104
|
-
|
|
105
|
-
|
|
118
|
+
if (item.tweet_results?.result &&
|
|
119
|
+
item.tweet_results?.result?.__typename == 'TweetWithVisibilityResults' &&
|
|
120
|
+
item.tweet_results?.result?.tweet?.legacy) {
|
|
106
121
|
tweets.push(new Tweet(item.tweet_results.result.tweet));
|
|
107
122
|
}
|
|
108
123
|
// If normal tweet
|
|
109
|
-
else if (
|
|
124
|
+
else if (item.tweet_results?.result?.legacy) {
|
|
110
125
|
// Logging
|
|
111
126
|
LogService_1.LogService.log(Logging_1.ELogActions.DESERIALIZE, { id: item.tweet_results.result.rest_id });
|
|
112
127
|
tweets.push(new Tweet(item.tweet_results.result));
|
|
@@ -116,12 +131,12 @@ var Tweet = /** @class */ (function () {
|
|
|
116
131
|
// Logging
|
|
117
132
|
LogService_1.LogService.log(Logging_1.ELogActions.WARNING, {
|
|
118
133
|
action: Logging_1.ELogActions.DESERIALIZE,
|
|
119
|
-
message:
|
|
134
|
+
message: `Tweet not found, skipping`,
|
|
120
135
|
});
|
|
121
136
|
}
|
|
122
137
|
}
|
|
123
138
|
return tweets;
|
|
124
|
-
}
|
|
139
|
+
}
|
|
125
140
|
/**
|
|
126
141
|
* Extracts and deserializes a single target tweet from the given raw response data.
|
|
127
142
|
*
|
|
@@ -132,13 +147,12 @@ var Tweet = /** @class */ (function () {
|
|
|
132
147
|
*
|
|
133
148
|
* @internal
|
|
134
149
|
*/
|
|
135
|
-
|
|
136
|
-
|
|
150
|
+
static single(response, id) {
|
|
151
|
+
const tweets = [];
|
|
137
152
|
// Extracting the matching data
|
|
138
|
-
|
|
153
|
+
const extract = (0, JsonUtils_1.findByFilter)(response, 'rest_id', id);
|
|
139
154
|
// Deserializing valid data
|
|
140
|
-
for (
|
|
141
|
-
var item = extract_2[_i];
|
|
155
|
+
for (const item of extract) {
|
|
142
156
|
if (item.legacy) {
|
|
143
157
|
// Logging
|
|
144
158
|
LogService_1.LogService.log(Logging_1.ELogActions.DESERIALIZE, { id: item.rest_id });
|
|
@@ -148,70 +162,67 @@ var Tweet = /** @class */ (function () {
|
|
|
148
162
|
// Logging
|
|
149
163
|
LogService_1.LogService.log(Logging_1.ELogActions.WARNING, {
|
|
150
164
|
action: Logging_1.ELogActions.DESERIALIZE,
|
|
151
|
-
message:
|
|
165
|
+
message: `Tweet not found, skipping`,
|
|
152
166
|
});
|
|
153
167
|
}
|
|
154
168
|
}
|
|
155
169
|
return tweets.length ? tweets[0] : undefined;
|
|
156
|
-
}
|
|
157
|
-
|
|
158
|
-
}());
|
|
170
|
+
}
|
|
171
|
+
}
|
|
159
172
|
exports.Tweet = Tweet;
|
|
160
173
|
/**
|
|
161
174
|
* The different types parsed entities like urls, media, mentions, hashtags, etc.
|
|
162
175
|
*
|
|
163
176
|
* @public
|
|
164
177
|
*/
|
|
165
|
-
|
|
178
|
+
class TweetEntities {
|
|
179
|
+
/** The list of hashtags mentioned in the tweet. */
|
|
180
|
+
hashtags = [];
|
|
181
|
+
/** The list of IDs of users mentioned in the tweet. */
|
|
182
|
+
mentionedUsers = [];
|
|
183
|
+
/** The list of urls mentioned in the tweet. */
|
|
184
|
+
urls = [];
|
|
166
185
|
/**
|
|
167
186
|
* @param entities - The raw tweet entities.
|
|
168
187
|
*/
|
|
169
|
-
|
|
170
|
-
/** The list of hashtags mentioned in the tweet. */
|
|
171
|
-
this.hashtags = [];
|
|
172
|
-
/** The list of IDs of users mentioned in the tweet. */
|
|
173
|
-
this.mentionedUsers = [];
|
|
174
|
-
/** The list of urls mentioned in the tweet. */
|
|
175
|
-
this.urls = [];
|
|
188
|
+
constructor(entities) {
|
|
176
189
|
// Extracting user mentions
|
|
177
190
|
if (entities.user_mentions) {
|
|
178
|
-
for (
|
|
179
|
-
var user = _a[_i];
|
|
191
|
+
for (const user of entities.user_mentions) {
|
|
180
192
|
this.mentionedUsers.push(user.screen_name);
|
|
181
193
|
}
|
|
182
194
|
}
|
|
183
195
|
// Extracting urls
|
|
184
196
|
if (entities.urls) {
|
|
185
|
-
for (
|
|
186
|
-
var url = _c[_b];
|
|
197
|
+
for (const url of entities.urls) {
|
|
187
198
|
this.urls.push(url.expanded_url);
|
|
188
199
|
}
|
|
189
200
|
}
|
|
190
201
|
// Extracting hashtags
|
|
191
202
|
if (entities.hashtags) {
|
|
192
|
-
for (
|
|
193
|
-
var hashtag = _e[_d];
|
|
203
|
+
for (const hashtag of entities.hashtags) {
|
|
194
204
|
this.hashtags.push(hashtag.text);
|
|
195
205
|
}
|
|
196
206
|
}
|
|
197
207
|
}
|
|
198
|
-
|
|
199
|
-
}());
|
|
208
|
+
}
|
|
200
209
|
exports.TweetEntities = TweetEntities;
|
|
201
210
|
/**
|
|
202
211
|
* The details of a single media content included in a tweet.
|
|
203
212
|
*
|
|
204
213
|
* @public
|
|
205
214
|
*/
|
|
206
|
-
|
|
215
|
+
class TweetMedia {
|
|
216
|
+
/** The thumbnail URL for the video content of the tweet. */
|
|
217
|
+
thumbnailUrl;
|
|
218
|
+
/** The type of media. */
|
|
219
|
+
type;
|
|
220
|
+
/** The direct URL to the media. */
|
|
221
|
+
url = '';
|
|
207
222
|
/**
|
|
208
223
|
* @param media - The raw media details.
|
|
209
224
|
*/
|
|
210
|
-
|
|
211
|
-
var _this = this;
|
|
212
|
-
var _a, _b;
|
|
213
|
-
/** The direct URL to the media. */
|
|
214
|
-
this.url = '';
|
|
225
|
+
constructor(media) {
|
|
215
226
|
this.type = media.type;
|
|
216
227
|
// If the media is a photo
|
|
217
228
|
if (media.type == rettiwt_core_1.EMediaType.PHOTO) {
|
|
@@ -219,25 +230,24 @@ var TweetMedia = /** @class */ (function () {
|
|
|
219
230
|
}
|
|
220
231
|
// If the media is a gif
|
|
221
232
|
else if (media.type == rettiwt_core_1.EMediaType.GIF) {
|
|
222
|
-
this.url =
|
|
233
|
+
this.url = media.video_info?.variants[0].url;
|
|
223
234
|
}
|
|
224
235
|
// If the media is a video
|
|
225
236
|
else {
|
|
226
237
|
this.thumbnailUrl = media.media_url_https;
|
|
227
238
|
/** The highest bitrate of all variants. */
|
|
228
|
-
|
|
239
|
+
let highestRate = 0;
|
|
229
240
|
/**
|
|
230
241
|
* Selecting the URL of the video variant with the highest bitrate.
|
|
231
242
|
*/
|
|
232
|
-
|
|
233
|
-
if (variant.bitrate >
|
|
234
|
-
|
|
235
|
-
|
|
243
|
+
media.video_info?.variants.forEach((variant) => {
|
|
244
|
+
if (variant.bitrate > highestRate) {
|
|
245
|
+
highestRate = variant.bitrate;
|
|
246
|
+
this.url = variant.url;
|
|
236
247
|
}
|
|
237
248
|
});
|
|
238
249
|
}
|
|
239
250
|
}
|
|
240
|
-
|
|
241
|
-
}());
|
|
251
|
+
}
|
|
242
252
|
exports.TweetMedia = TweetMedia;
|
|
243
253
|
//# sourceMappingURL=Tweet.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tweet.js","sourceRoot":"","sources":["../../../src/models/data/Tweet.ts"],"names":[],"mappings":";;;AAAA
|
|
1
|
+
{"version":3,"file":"Tweet.js","sourceRoot":"","sources":["../../../src/models/data/Tweet.ts"],"names":[],"mappings":";;;AAAA,+CAOsB;AAEtB,iDAAkD;AAClD,sDAAsD;AAEtD,mEAAgE;AAIhE,iCAA8B;AAE9B;;;;GAIG;AACH,MAAa,KAAK;IACV,aAAa,CAAS;IACtB,cAAc,CAAS;IACvB,SAAS,CAAS;IAClB,QAAQ,CAAgB;IACxB,QAAQ,CAAS;IACjB,EAAE,CAAS;IACX,IAAI,CAAS;IACb,SAAS,CAAS;IAClB,KAAK,CAAgB;IACrB,UAAU,CAAS;IACnB,MAAM,CAAS;IACf,UAAU,CAAS;IACnB,OAAO,CAAU;IACjB,YAAY,CAAS;IACrB,cAAc,CAAS;IACvB,OAAO,CAAO;IACd,GAAG,CAAS;IACZ,SAAS,CAAS;IAEzB;;OAEG;IACH,YAAmB,KAAgB;QAClC,IAAI,CAAC,EAAE,GAAG,KAAK,CAAC,OAA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AAC,GAAG,GAAG,KAAK,CAAC,UAAU,EAAE,QAAQ,CAAC,CAAC,CAAC,CAAC,GAAa,CAAC;QACxD,CAAC;QACD,0BAA0B;aACrB,CAAC;YACL,IAAI,CAAC,YAAY,GAAG,KAAK,CAAC,eAAe,CAAC;YAE1C,2CAA2C;YAC3C,IAAI,WAAW,GAAG,CAAC,CAAC;YAEpB;;eAEG;YACH,KAAK,CAAC,UAAU,EAAE,QAAQ,CAAC,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;gBAC9C,IAAI,OAAO,CAAC,OAAO,GAAG,WAAW,EAAE,CAAC;oBACnC,WAAW,GAAG,OAAO,CAAC,OAAO,CAAC;oBAC9B,IAAI,CAAC,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC;gBACxB,CAAC;YACF,CAAC,CAAC,CAAC;QACJ,CAAC;IACF,CAAC;CACD;AA1CD,gCA0CC"}
|
|
@@ -1,37 +1,24 @@
|
|
|
1
1
|
import { IUser as IRawUser } from 'rettiwt-core';
|
|
2
|
+
import { IUser } from '../../types/data/User';
|
|
2
3
|
/**
|
|
3
4
|
* The details of a single user.
|
|
4
5
|
*
|
|
5
6
|
* @public
|
|
6
7
|
*/
|
|
7
|
-
export declare class User {
|
|
8
|
-
/** The creation date of user's account. */
|
|
8
|
+
export declare class User implements IUser {
|
|
9
9
|
createdAt: string;
|
|
10
|
-
/** The user's description. */
|
|
11
10
|
description?: string;
|
|
12
|
-
/** The number of followers of the user. */
|
|
13
11
|
followersCount: number;
|
|
14
|
-
/** The number of following of the user. */
|
|
15
12
|
followingsCount: number;
|
|
16
|
-
/** The full name of the user. */
|
|
17
13
|
fullName: string;
|
|
18
|
-
/** The rest id of the user. */
|
|
19
14
|
id: string;
|
|
20
|
-
/** Whether the account is verified or not. */
|
|
21
15
|
isVerified: boolean;
|
|
22
|
-
/** The number of tweets liked by the user. */
|
|
23
16
|
likeCount: number;
|
|
24
|
-
/** The location of user as provided by user. */
|
|
25
17
|
location?: string;
|
|
26
|
-
/** The rest id of the tweet pinned in the user's profile. */
|
|
27
18
|
pinnedTweet?: string;
|
|
28
|
-
/** The url of the profile banner image. */
|
|
29
19
|
profileBanner?: string;
|
|
30
|
-
/** The url of the profile image. */
|
|
31
20
|
profileImage: string;
|
|
32
|
-
/** The number of tweets made by the user. */
|
|
33
21
|
statusesCount: number;
|
|
34
|
-
/** The username/screenname of the user. */
|
|
35
22
|
userName: string;
|
|
36
23
|
/**
|
|
37
24
|
* @param user - The raw user details.
|
package/dist/models/data/User.js
CHANGED
|
@@ -1,19 +1,33 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.User = void 0;
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
4
|
+
const Logging_1 = require("../../enums/Logging");
|
|
5
|
+
const JsonUtils_1 = require("../../helper/JsonUtils");
|
|
6
|
+
const LogService_1 = require("../../services/internal/LogService");
|
|
7
7
|
/**
|
|
8
8
|
* The details of a single user.
|
|
9
9
|
*
|
|
10
10
|
* @public
|
|
11
11
|
*/
|
|
12
|
-
|
|
12
|
+
class User {
|
|
13
|
+
createdAt;
|
|
14
|
+
description;
|
|
15
|
+
followersCount;
|
|
16
|
+
followingsCount;
|
|
17
|
+
fullName;
|
|
18
|
+
id;
|
|
19
|
+
isVerified;
|
|
20
|
+
likeCount;
|
|
21
|
+
location;
|
|
22
|
+
pinnedTweet;
|
|
23
|
+
profileBanner;
|
|
24
|
+
profileImage;
|
|
25
|
+
statusesCount;
|
|
26
|
+
userName;
|
|
13
27
|
/**
|
|
14
28
|
* @param user - The raw user details.
|
|
15
29
|
*/
|
|
16
|
-
|
|
30
|
+
constructor(user) {
|
|
17
31
|
this.id = user.rest_id;
|
|
18
32
|
this.userName = user.legacy.screen_name;
|
|
19
33
|
this.fullName = user.legacy.name;
|
|
@@ -38,15 +52,13 @@ var User = /** @class */ (function () {
|
|
|
38
52
|
*
|
|
39
53
|
* @internal
|
|
40
54
|
*/
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
var users = [];
|
|
55
|
+
static list(response) {
|
|
56
|
+
const users = [];
|
|
44
57
|
// Extracting the matching data
|
|
45
|
-
|
|
58
|
+
const extract = (0, JsonUtils_1.findByFilter)(response, '__typename', 'TimelineUser');
|
|
46
59
|
// Deserializing valid data
|
|
47
|
-
for (
|
|
48
|
-
|
|
49
|
-
if ((_b = (_a = item.user_results) === null || _a === void 0 ? void 0 : _a.result) === null || _b === void 0 ? void 0 : _b.legacy) {
|
|
60
|
+
for (const item of extract) {
|
|
61
|
+
if (item.user_results?.result?.legacy) {
|
|
50
62
|
// Logging
|
|
51
63
|
LogService_1.LogService.log(Logging_1.ELogActions.DESERIALIZE, { id: item.user_results.result.rest_id });
|
|
52
64
|
users.push(new User(item.user_results.result));
|
|
@@ -55,12 +67,12 @@ var User = /** @class */ (function () {
|
|
|
55
67
|
// Logging
|
|
56
68
|
LogService_1.LogService.log(Logging_1.ELogActions.WARNING, {
|
|
57
69
|
action: Logging_1.ELogActions.DESERIALIZE,
|
|
58
|
-
message:
|
|
70
|
+
message: `User not found, skipping`,
|
|
59
71
|
});
|
|
60
72
|
}
|
|
61
73
|
}
|
|
62
74
|
return users;
|
|
63
|
-
}
|
|
75
|
+
}
|
|
64
76
|
/**
|
|
65
77
|
* Extracts and deserializes a single target user from the given raw response data.
|
|
66
78
|
*
|
|
@@ -70,13 +82,12 @@ var User = /** @class */ (function () {
|
|
|
70
82
|
*
|
|
71
83
|
* @internal
|
|
72
84
|
*/
|
|
73
|
-
|
|
74
|
-
|
|
85
|
+
static single(response) {
|
|
86
|
+
const users = [];
|
|
75
87
|
// Extracting the matching data
|
|
76
|
-
|
|
88
|
+
const extract = (0, JsonUtils_1.findByFilter)(response, '__typename', 'User');
|
|
77
89
|
// Deserializing valid data
|
|
78
|
-
for (
|
|
79
|
-
var item = extract_2[_i];
|
|
90
|
+
for (const item of extract) {
|
|
80
91
|
if (item.legacy && item.legacy.created_at) {
|
|
81
92
|
// Logging
|
|
82
93
|
LogService_1.LogService.log(Logging_1.ELogActions.DESERIALIZE, { id: item.rest_id });
|
|
@@ -86,13 +97,12 @@ var User = /** @class */ (function () {
|
|
|
86
97
|
// Logging
|
|
87
98
|
LogService_1.LogService.log(Logging_1.ELogActions.WARNING, {
|
|
88
99
|
action: Logging_1.ELogActions.DESERIALIZE,
|
|
89
|
-
message:
|
|
100
|
+
message: `User not found, skipping`,
|
|
90
101
|
});
|
|
91
102
|
}
|
|
92
103
|
}
|
|
93
104
|
return users.length ? users[0] : undefined;
|
|
94
|
-
}
|
|
95
|
-
|
|
96
|
-
}());
|
|
105
|
+
}
|
|
106
|
+
}
|
|
97
107
|
exports.User = User;
|
|
98
108
|
//# sourceMappingURL=User.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"User.js","sourceRoot":"","sources":["../../../src/models/data/User.ts"],"names":[],"mappings":";;;AAEA
|
|
1
|
+
{"version":3,"file":"User.js","sourceRoot":"","sources":["../../../src/models/data/User.ts"],"names":[],"mappings":";;;AAEA,iDAAkD;AAClD,sDAAsD;AACtD,mEAAgE;AAGhE;;;;GAIG;AACH,MAAa,IAAI;IACT,SAAS,CAAS;IAClB,WAAW,CAAU;IACrB,cAAc,CAAS;IACvB,eAAe,CAAS;IACxB,QAAQ,CAAS;IACjB,EAAE,CAAS;IACX,UAAU,CAAU;IACpB,SAAS,CAAS;IAClB,QAAQ,CAAU;IAClB,WAAW,CAAU;IACrB,aAAa,CAAU;IACvB,YAAY,CAAS;IACrB,aAAa,CAAS;IACtB,QAAQ,CAAS;IAExB;;OAEG;IACH,YAAmB,IAAc;QAChC,IAAI,CAAC,EAAE,GAAG,IAAI,CAAC,OAAO,CAAC;QACvB,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,WAAW,CAAC;QACxC,IAAI,CAAC,QAAQ,GAAG,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;QACjC,IAAI,CAAC,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AAC;QAED,OAAO,KAAK,CAAC,MAAM,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,SAAS,CAAC;IAC5C,CAAC;CACD;AAvGD,oBAuGC"}
|
|
@@ -1,39 +1,23 @@
|
|
|
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
3
|
exports.ApiError = void 0;
|
|
19
|
-
|
|
4
|
+
const RettiwtError_1 = require("./RettiwtError");
|
|
20
5
|
/**
|
|
21
6
|
* Represents an error that is thrown by Twitter API.
|
|
22
7
|
*
|
|
23
8
|
* @public
|
|
24
9
|
*/
|
|
25
|
-
|
|
26
|
-
|
|
10
|
+
class ApiError extends RettiwtError_1.RettiwtError {
|
|
11
|
+
/** The error code thrown by Twitter API. */
|
|
12
|
+
code;
|
|
27
13
|
/**
|
|
28
14
|
* @param errorCode - The error code thrown by Twitter API.
|
|
29
15
|
* @param message - Any additional error message.
|
|
30
16
|
*/
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return _this;
|
|
17
|
+
constructor(errorCode, message) {
|
|
18
|
+
super(message);
|
|
19
|
+
this.code = errorCode;
|
|
35
20
|
}
|
|
36
|
-
|
|
37
|
-
}(RettiwtError_1.RettiwtError));
|
|
21
|
+
}
|
|
38
22
|
exports.ApiError = ApiError;
|
|
39
23
|
//# sourceMappingURL=ApiError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ApiError.js","sourceRoot":"","sources":["../../../src/models/errors/ApiError.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"ApiError.js","sourceRoot":"","sources":["../../../src/models/errors/ApiError.ts"],"names":[],"mappings":";;;AAAA,iDAA8C;AAE9C;;;;GAIG;AACH,MAAa,QAAS,SAAQ,2BAAY;IACzC,4CAA4C;IACrC,IAAI,CAAS;IAEpB;;;OAGG;IACH,YAAmB,SAAiB,EAAE,OAAgB;QACrD,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,IAAI,GAAG,SAAS,CAAC;IACvB,CAAC;CACD;AAbD,4BAaC"}
|
|
@@ -1,39 +1,23 @@
|
|
|
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
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
18
3
|
exports.HttpError = void 0;
|
|
19
|
-
|
|
4
|
+
const RettiwtError_1 = require("./RettiwtError");
|
|
20
5
|
/**
|
|
21
6
|
* Represents an HTTP error that occues while making a request to Twitter API.
|
|
22
7
|
*
|
|
23
8
|
* @public
|
|
24
9
|
*/
|
|
25
|
-
|
|
26
|
-
|
|
10
|
+
class HttpError extends RettiwtError_1.RettiwtError {
|
|
11
|
+
/** The HTTP status code. */
|
|
12
|
+
status;
|
|
27
13
|
/**
|
|
28
14
|
* @param httpStatus - The HTTP status code received upon making the request
|
|
29
15
|
* @param message - Any additional error message.
|
|
30
16
|
*/
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
return _this;
|
|
17
|
+
constructor(httpStatus, message) {
|
|
18
|
+
super(message);
|
|
19
|
+
this.status = httpStatus;
|
|
35
20
|
}
|
|
36
|
-
|
|
37
|
-
}(RettiwtError_1.RettiwtError));
|
|
21
|
+
}
|
|
38
22
|
exports.HttpError = HttpError;
|
|
39
23
|
//# sourceMappingURL=HttpError.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"HttpError.js","sourceRoot":"","sources":["../../../src/models/errors/HttpError.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"HttpError.js","sourceRoot":"","sources":["../../../src/models/errors/HttpError.ts"],"names":[],"mappings":";;;AAAA,iDAA8C;AAE9C;;;;GAIG;AACH,MAAa,SAAU,SAAQ,2BAAY;IAC1C,4BAA4B;IACrB,MAAM,CAAS;IAEtB;;;OAGG;IACH,YAAmB,UAAkB,EAAE,OAAgB;QACtD,KAAK,CAAC,OAAO,CAAC,CAAC;QAEf,IAAI,CAAC,MAAM,GAAG,UAAU,CAAC;IAC1B,CAAC;CACD;AAbD,8BAaC"}
|