rettiwt-api 5.0.1 → 6.0.0
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 +13 -8
- package/README.md +8 -1
- package/dist/cli.js +17 -14
- package/dist/cli.js.map +1 -1
- package/dist/collections/Extractors.d.ts +1 -1
- package/dist/collections/Extractors.js +21 -21
- package/dist/collections/Extractors.js.map +1 -1
- package/dist/collections/Groups.d.ts +4 -4
- package/dist/collections/Groups.js +45 -45
- package/dist/collections/Groups.js.map +1 -1
- package/dist/collections/Requests.d.ts +3 -3
- package/dist/collections/Requests.js +3 -3
- package/dist/collections/Requests.js.map +1 -1
- package/dist/collections/Tweet.d.ts +4 -4
- package/dist/collections/Tweet.js +5 -5
- package/dist/collections/Tweet.js.map +1 -1
- package/dist/commands/Tweet.js +48 -12
- package/dist/commands/Tweet.js.map +1 -1
- package/dist/enums/Api.d.ts +1 -1
- package/dist/enums/Api.js +7 -7
- package/dist/enums/Api.js.map +1 -1
- package/dist/enums/Authentication.d.ts +1 -1
- package/dist/enums/Authentication.js +7 -7
- package/dist/enums/Authentication.js.map +1 -1
- package/dist/enums/Data.d.ts +1 -1
- package/dist/enums/Data.js +7 -7
- package/dist/enums/Data.js.map +1 -1
- package/dist/enums/Logging.d.ts +1 -1
- package/dist/enums/Logging.js +11 -11
- package/dist/enums/Logging.js.map +1 -1
- package/dist/enums/Media.d.ts +1 -1
- package/dist/enums/Media.js +7 -7
- package/dist/enums/Media.js.map +1 -1
- package/dist/enums/Notification.d.ts +1 -1
- package/dist/enums/Notification.js +9 -9
- package/dist/enums/Notification.js.map +1 -1
- package/dist/enums/Resource.d.ts +1 -1
- package/dist/enums/Resource.js +42 -42
- package/dist/enums/Resource.js.map +1 -1
- package/dist/enums/Tweet.d.ts +1 -1
- package/dist/enums/Tweet.js +7 -7
- package/dist/enums/Tweet.js.map +1 -1
- package/dist/enums/raw/Analytics.d.ts +2 -2
- package/dist/enums/raw/Analytics.js +21 -21
- package/dist/enums/raw/Analytics.js.map +1 -1
- package/dist/enums/raw/Media.d.ts +1 -1
- package/dist/enums/raw/Media.js +7 -7
- package/dist/enums/raw/Media.js.map +1 -1
- package/dist/enums/raw/Notification.d.ts +1 -1
- package/dist/enums/raw/Notification.js +8 -8
- package/dist/enums/raw/Notification.js.map +1 -1
- package/dist/enums/raw/Tweet.d.ts +2 -2
- package/dist/enums/raw/Tweet.js +12 -12
- package/dist/enums/raw/Tweet.js.map +1 -1
- package/dist/models/RettiwtConfig.d.ts +3 -2
- package/dist/models/RettiwtConfig.js +7 -5
- package/dist/models/RettiwtConfig.js.map +1 -1
- package/dist/models/args/FetchArgs.d.ts +7 -5
- package/dist/models/args/FetchArgs.js +15 -9
- package/dist/models/args/FetchArgs.js.map +1 -1
- package/dist/models/auth/AuthCredential.d.ts +2 -2
- package/dist/models/auth/AuthCredential.js +3 -3
- package/dist/models/auth/AuthCredential.js.map +1 -1
- package/dist/models/data/CursoredData.d.ts +2 -2
- package/dist/models/data/CursoredData.js +3 -3
- package/dist/models/data/CursoredData.js.map +1 -1
- package/dist/models/data/Notification.d.ts +2 -2
- package/dist/models/data/Notification.js +3 -3
- package/dist/models/data/Notification.js.map +1 -1
- package/dist/models/data/Tweet.d.ts +4 -4
- package/dist/models/data/Tweet.js +18 -18
- package/dist/models/data/Tweet.js.map +1 -1
- package/dist/models/data/User.js +9 -9
- package/dist/models/data/User.js.map +1 -1
- package/dist/requests/Tweet.d.ts +2 -2
- package/dist/requests/Tweet.js +2 -2
- package/dist/requests/Tweet.js.map +1 -1
- package/dist/requests/User.d.ts +2 -2
- package/dist/requests/User.js.map +1 -1
- package/dist/services/internal/AuthService.js +1 -1
- package/dist/services/internal/AuthService.js.map +1 -1
- package/dist/services/internal/ErrorService.d.ts +2 -2
- package/dist/services/internal/ErrorService.js +4 -4
- package/dist/services/internal/ErrorService.js.map +1 -1
- package/dist/services/internal/LogService.d.ts +2 -2
- package/dist/services/internal/LogService.js.map +1 -1
- package/dist/services/internal/TidService.d.ts +4 -4
- package/dist/services/internal/TidService.js +10 -10
- package/dist/services/internal/TidService.js.map +1 -1
- package/dist/services/public/FetcherService.d.ts +7 -7
- package/dist/services/public/FetcherService.js +79 -35
- package/dist/services/public/FetcherService.js.map +1 -1
- package/dist/services/public/ListService.js +4 -4
- package/dist/services/public/ListService.js.map +1 -1
- package/dist/services/public/TweetService.d.ts +3 -3
- package/dist/services/public/TweetService.js +35 -35
- package/dist/services/public/TweetService.js.map +1 -1
- package/dist/services/public/UserService.js +37 -37
- package/dist/services/public/UserService.js.map +1 -1
- package/dist/types/RettiwtConfig.d.ts +6 -0
- package/dist/types/args/FetchArgs.d.ts +14 -6
- package/dist/types/auth/AuthCredential.d.ts +2 -2
- package/dist/types/data/Notification.d.ts +2 -2
- package/dist/types/data/Tweet.d.ts +2 -2
- package/dist/types/raw/base/Media.d.ts +2 -2
- package/dist/types/raw/base/Notification.d.ts +2 -2
- package/package.json +18 -18
- package/src/cli.ts +20 -14
- package/src/collections/Extractors.ts +21 -21
- package/src/collections/Groups.ts +45 -45
- package/src/collections/Requests.ts +4 -4
- package/src/collections/Tweet.ts +6 -6
- package/src/commands/Tweet.ts +49 -12
- package/src/enums/Api.ts +1 -1
- package/src/enums/Authentication.ts +1 -1
- package/src/enums/Data.ts +1 -1
- package/src/enums/Logging.ts +1 -1
- package/src/enums/Media.ts +1 -1
- package/src/enums/Notification.ts +1 -1
- package/src/enums/Resource.ts +1 -1
- package/src/enums/Tweet.ts +1 -1
- package/src/enums/raw/Analytics.ts +2 -2
- package/src/enums/raw/Media.ts +1 -1
- package/src/enums/raw/Notification.ts +1 -1
- package/src/enums/raw/Tweet.ts +2 -2
- package/src/models/RettiwtConfig.ts +7 -5
- package/src/models/args/FetchArgs.ts +17 -11
- package/src/models/auth/AuthCredential.ts +5 -5
- package/src/models/data/CursoredData.ts +5 -5
- package/src/models/data/Notification.ts +6 -6
- package/src/models/data/Tweet.ts +22 -22
- package/src/models/data/User.ts +10 -10
- package/src/requests/Tweet.ts +4 -4
- package/src/requests/User.ts +3 -3
- package/src/services/internal/AuthService.ts +2 -2
- package/src/services/internal/ErrorService.ts +4 -4
- package/src/services/internal/LogService.ts +2 -2
- package/src/services/internal/TidService.ts +11 -11
- package/src/services/public/FetcherService.ts +54 -38
- package/src/services/public/ListService.ts +6 -6
- package/src/services/public/TweetService.ts +39 -39
- package/src/services/public/UserService.ts +40 -40
- package/src/types/RettiwtConfig.ts +7 -0
- package/src/types/args/FetchArgs.ts +18 -8
- package/src/types/auth/AuthCredential.ts +2 -2
- package/src/types/data/Notification.ts +2 -2
- package/src/types/data/Tweet.ts +2 -2
- package/src/types/raw/base/Media.ts +2 -2
- package/src/types/raw/base/Notification.ts +2 -2
- package/.tool-versions +0 -1
package/.eslintrc.js
CHANGED
|
@@ -22,38 +22,43 @@ module.exports = {
|
|
|
22
22
|
'@typescript-eslint/naming-convention': [
|
|
23
23
|
'warn',
|
|
24
24
|
{
|
|
25
|
-
selector: ['class'],
|
|
25
|
+
selector: ['class', 'enum'],
|
|
26
26
|
format: ['PascalCase'],
|
|
27
27
|
},
|
|
28
28
|
{
|
|
29
|
-
selector: 'interface',
|
|
29
|
+
selector: ['interface'],
|
|
30
30
|
format: ['PascalCase'],
|
|
31
31
|
prefix: ['I'],
|
|
32
32
|
},
|
|
33
33
|
{
|
|
34
|
-
selector: '
|
|
34
|
+
selector: ['typeAlias'],
|
|
35
35
|
format: ['PascalCase'],
|
|
36
|
-
prefix: ['E'],
|
|
37
36
|
},
|
|
38
37
|
{
|
|
39
|
-
selector: ['
|
|
38
|
+
selector: ['memberLike', 'variableLike'],
|
|
40
39
|
format: ['camelCase'],
|
|
40
|
+
leadingUnderscore: 'allow',
|
|
41
41
|
},
|
|
42
42
|
{
|
|
43
|
-
selector: ['
|
|
43
|
+
selector: ['memberLike'],
|
|
44
44
|
modifiers: ['private'],
|
|
45
45
|
format: ['camelCase'],
|
|
46
46
|
leadingUnderscore: 'require',
|
|
47
47
|
},
|
|
48
48
|
{
|
|
49
|
-
selector: ['
|
|
49
|
+
selector: ['memberLike'],
|
|
50
50
|
modifiers: ['static', 'readonly'],
|
|
51
51
|
format: ['UPPER_CASE'],
|
|
52
52
|
},
|
|
53
53
|
{
|
|
54
|
-
selector: 'enumMember',
|
|
54
|
+
selector: ['enumMember'],
|
|
55
55
|
format: ['UPPER_CASE'],
|
|
56
56
|
},
|
|
57
|
+
{
|
|
58
|
+
selector: ['variable'],
|
|
59
|
+
modifiers: ['global'],
|
|
60
|
+
format: ['PascalCase'],
|
|
61
|
+
},
|
|
57
62
|
],
|
|
58
63
|
'@typescript-eslint/explicit-function-return-type': 'error',
|
|
59
64
|
'@typescript-eslint/explicit-module-boundary-types': 'error',
|
package/README.md
CHANGED
|
@@ -143,7 +143,8 @@ When initializing a new Rettiwt instance, it can be configures using various par
|
|
|
143
143
|
- `errorHandler` (interface) - The custom error handler to use.
|
|
144
144
|
- `tidProvider` (interface) - The custom TID provider to use for generating transaction token.
|
|
145
145
|
- `headers` (object) - Custom HTTP headers to append to the default headers.
|
|
146
|
-
- `delay` (number/function) - The delay to use between concurrent requests, can either be a number in milliseconds, or a function that returns the number.
|
|
146
|
+
- `delay` (number/function) - The delay to use between concurrent requests, can either be a number in milliseconds, or a function that returns the number. Default is 1000.
|
|
147
|
+
- `maxRetries` (number) - The maximum number of retries to use in case when a random error 404 is encountered. Default is 5.
|
|
147
148
|
|
|
148
149
|
Of these parameters, the following are hot-swappable, using their respective setters:
|
|
149
150
|
|
|
@@ -423,6 +424,12 @@ As demonstrated by the example, the raw data can be accessed by using the `reque
|
|
|
423
424
|
|
|
424
425
|
- For for hot-swapping in case of using `FetcherService`, the setters are accessed from the `config` object as `config.apiKey = ...`, `config.proxyUrl = ...`, etc.
|
|
425
426
|
|
|
427
|
+
## Data serialization
|
|
428
|
+
|
|
429
|
+
The data returned by all functions of `Rettiwt` are complex objects, containing non-serialized fields like `raw`. In order to get JSON-serializable data, all data objects returned by `Rettiwt` provide a function `toJSON()` which converts the data into a serializable JSON, whose type is described by their respective interfaces i.e, `ITweet` for `Tweet`, `IUser` for `User` and so on.
|
|
430
|
+
|
|
431
|
+
For handling and processing of data returned by the functions, it's always advisable to serialize them using the `toJSON()` function.
|
|
432
|
+
|
|
426
433
|
## Features
|
|
427
434
|
|
|
428
435
|
So far, the following operations are supported:
|
package/dist/cli.js
CHANGED
|
@@ -10,29 +10,32 @@ const Tweet_1 = __importDefault(require("./commands/Tweet"));
|
|
|
10
10
|
const User_1 = __importDefault(require("./commands/User"));
|
|
11
11
|
const Rettiwt_1 = require("./Rettiwt");
|
|
12
12
|
// Creating a new commandline program
|
|
13
|
-
const
|
|
13
|
+
const Program = (0, commander_1.createCommand)('rettiwt')
|
|
14
14
|
.description('A CLI tool for accessing the Twitter API for free!')
|
|
15
15
|
.passThroughOptions()
|
|
16
16
|
.enablePositionalOptions();
|
|
17
17
|
// Adding options
|
|
18
|
-
|
|
19
|
-
.option('-k, --key <string>', 'The API key to use for authentication')
|
|
18
|
+
Program.option('-k, --key <string>', 'The API key to use for authentication')
|
|
20
19
|
.option('-l, --log', 'Enable logging to console')
|
|
21
20
|
.option('-p, --proxy <string>', 'The URL to the proxy to use')
|
|
22
|
-
.option('-t, --timeout <number>', 'The timout (in milli-seconds) to use for requests')
|
|
21
|
+
.option('-t, --timeout <number>', 'The timout (in milli-seconds) to use for requests')
|
|
22
|
+
.option('-r, --retries <number>', 'The maximum number of retries to use, a value of 5 combined with a delay of 1000 is recommended')
|
|
23
|
+
.option('-d, --delay <number>', 'The delay in milliseconds to use in-between successive requests');
|
|
23
24
|
// Parsing the program to get supplied options
|
|
24
|
-
|
|
25
|
+
Program.parse();
|
|
25
26
|
// Initializing Rettiwt instance using the given options
|
|
26
|
-
const
|
|
27
|
-
apiKey: process.env.API_KEY ??
|
|
28
|
-
logging:
|
|
29
|
-
proxyUrl:
|
|
30
|
-
timeout:
|
|
27
|
+
const RettiwtInstance = new Rettiwt_1.Rettiwt({
|
|
28
|
+
apiKey: process.env.API_KEY ?? Program.opts().key,
|
|
29
|
+
logging: Program.opts().log ? true : false,
|
|
30
|
+
proxyUrl: Program.opts().proxy,
|
|
31
|
+
timeout: Program.opts().timeout ? Number(Program.opts().timeout) : undefined,
|
|
32
|
+
maxRetries: Program.opts().retries,
|
|
33
|
+
delay: Program.opts().delay,
|
|
31
34
|
});
|
|
32
35
|
// Adding sub-commands
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
+
Program.addCommand((0, List_1.default)(RettiwtInstance));
|
|
37
|
+
Program.addCommand((0, Tweet_1.default)(RettiwtInstance));
|
|
38
|
+
Program.addCommand((0, User_1.default)(RettiwtInstance));
|
|
36
39
|
// Finalizing the CLI
|
|
37
|
-
|
|
40
|
+
Program.parse();
|
|
38
41
|
//# sourceMappingURL=cli.js.map
|
package/dist/cli.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;AAEA,yCAA0C;AAE1C,2DAAmC;AACnC,6DAAqC;AACrC,2DAAmC;AACnC,uCAAoC;AAEpC,qCAAqC;AACrC,MAAM,OAAO,GAAG,IAAA,yBAAa,EAAC,SAAS,CAAC;KACtC,WAAW,CAAC,oDAAoD,CAAC;KACjE,kBAAkB,EAAE;KACpB,uBAAuB,EAAE,CAAC;AAE5B,iBAAiB;AACjB,OAAO
|
|
1
|
+
{"version":3,"file":"cli.js","sourceRoot":"","sources":["../src/cli.ts"],"names":[],"mappings":";;;;;;AAEA,yCAA0C;AAE1C,2DAAmC;AACnC,6DAAqC;AACrC,2DAAmC;AACnC,uCAAoC;AAEpC,qCAAqC;AACrC,MAAM,OAAO,GAAG,IAAA,yBAAa,EAAC,SAAS,CAAC;KACtC,WAAW,CAAC,oDAAoD,CAAC;KACjE,kBAAkB,EAAE;KACpB,uBAAuB,EAAE,CAAC;AAE5B,iBAAiB;AACjB,OAAO,CAAC,MAA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IUserUnfollowResponse } from '../types/raw/user/Unfollow';
|
|
|
41
41
|
*
|
|
42
42
|
* @internal
|
|
43
43
|
*/
|
|
44
|
-
export declare const
|
|
44
|
+
export declare const Extractors: {
|
|
45
45
|
LIST_MEMBERS: (response: IListMembersResponse) => CursoredData<User>;
|
|
46
46
|
LIST_TWEETS: (response: IListTweetsResponse) => CursoredData<Tweet>;
|
|
47
47
|
MEDIA_UPLOAD_APPEND: () => void;
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.Extractors = void 0;
|
|
4
4
|
const Data_1 = require("../enums/Data");
|
|
5
5
|
const CursoredData_1 = require("../models/data/CursoredData");
|
|
6
6
|
const Tweet_1 = require("../models/data/Tweet");
|
|
@@ -10,10 +10,10 @@ const User_1 = require("../models/data/User");
|
|
|
10
10
|
*
|
|
11
11
|
* @internal
|
|
12
12
|
*/
|
|
13
|
-
exports.
|
|
13
|
+
exports.Extractors = {
|
|
14
14
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
15
|
-
LIST_MEMBERS: (response) => new CursoredData_1.CursoredData(response, Data_1.
|
|
16
|
-
LIST_TWEETS: (response) => new CursoredData_1.CursoredData(response, Data_1.
|
|
15
|
+
LIST_MEMBERS: (response) => new CursoredData_1.CursoredData(response, Data_1.BaseType.USER),
|
|
16
|
+
LIST_TWEETS: (response) => new CursoredData_1.CursoredData(response, Data_1.BaseType.TWEET),
|
|
17
17
|
MEDIA_UPLOAD_APPEND: () => undefined,
|
|
18
18
|
MEDIA_UPLOAD_FINALIZE: () => undefined,
|
|
19
19
|
MEDIA_UPLOAD_INITIALIZE: (response) => response.media_id_string ?? undefined,
|
|
@@ -21,34 +21,34 @@ exports.extractors = {
|
|
|
21
21
|
TWEET_DETAILS_ALT: (response, id) => Tweet_1.Tweet.single(response, id),
|
|
22
22
|
TWEET_DETAILS_BULK: (response, ids) => Tweet_1.Tweet.multiple(response, ids),
|
|
23
23
|
TWEET_LIKE: (response) => (response?.data?.favorite_tweet ? true : false),
|
|
24
|
-
TWEET_LIKERS: (response) => new CursoredData_1.CursoredData(response, Data_1.
|
|
24
|
+
TWEET_LIKERS: (response) => new CursoredData_1.CursoredData(response, Data_1.BaseType.USER),
|
|
25
25
|
TWEET_POST: (response) => response?.data?.create_tweet?.tweet_results?.result?.rest_id ?? undefined,
|
|
26
|
-
TWEET_REPLIES: (response) => new CursoredData_1.CursoredData(response, Data_1.
|
|
26
|
+
TWEET_REPLIES: (response) => new CursoredData_1.CursoredData(response, Data_1.BaseType.TWEET),
|
|
27
27
|
TWEET_RETWEET: (response) => (response?.data?.create_retweet ? true : false),
|
|
28
|
-
TWEET_RETWEETERS: (response) => new CursoredData_1.CursoredData(response, Data_1.
|
|
28
|
+
TWEET_RETWEETERS: (response) => new CursoredData_1.CursoredData(response, Data_1.BaseType.USER),
|
|
29
29
|
TWEET_SCHEDULE: (response) => response?.data?.tweet?.rest_id ?? undefined,
|
|
30
|
-
TWEET_SEARCH: (response) => new CursoredData_1.CursoredData(response, Data_1.
|
|
30
|
+
TWEET_SEARCH: (response) => new CursoredData_1.CursoredData(response, Data_1.BaseType.TWEET),
|
|
31
31
|
TWEET_UNLIKE: (response) => (response?.data?.unfavorite_tweet ? true : false),
|
|
32
32
|
TWEET_UNPOST: (response) => (response?.data?.delete_tweet ? true : false),
|
|
33
33
|
TWEET_UNRETWEET: (response) => response?.data?.unretweet?.source_tweet_results?.result ? true : false,
|
|
34
34
|
TWEET_UNSCHEDULE: (response) => response?.data?.scheduledtweet_delete == 'Done',
|
|
35
|
-
USER_AFFILIATES: (response) => new CursoredData_1.CursoredData(response, Data_1.
|
|
36
|
-
USER_BOOKMARKS: (response) => new CursoredData_1.CursoredData(response, Data_1.
|
|
35
|
+
USER_AFFILIATES: (response) => new CursoredData_1.CursoredData(response, Data_1.BaseType.USER),
|
|
36
|
+
USER_BOOKMARKS: (response) => new CursoredData_1.CursoredData(response, Data_1.BaseType.TWEET),
|
|
37
37
|
USER_DETAILS_BY_USERNAME: (response) => User_1.User.single(response),
|
|
38
38
|
USER_DETAILS_BY_ID: (response) => User_1.User.single(response),
|
|
39
39
|
USER_DETAILS_BY_IDS_BULK: (response, ids) => User_1.User.multiple(response, ids),
|
|
40
|
-
USER_FEED_FOLLOWED: (response) => new CursoredData_1.CursoredData(response, Data_1.
|
|
41
|
-
USER_FEED_RECOMMENDED: (response) => new CursoredData_1.CursoredData(response, Data_1.
|
|
40
|
+
USER_FEED_FOLLOWED: (response) => new CursoredData_1.CursoredData(response, Data_1.BaseType.TWEET),
|
|
41
|
+
USER_FEED_RECOMMENDED: (response) => new CursoredData_1.CursoredData(response, Data_1.BaseType.TWEET),
|
|
42
42
|
USER_FOLLOW: (response) => (response?.id ? true : false),
|
|
43
|
-
USER_FOLLOWING: (response) => new CursoredData_1.CursoredData(response, Data_1.
|
|
44
|
-
USER_FOLLOWERS: (response) => new CursoredData_1.CursoredData(response, Data_1.
|
|
45
|
-
USER_HIGHLIGHTS: (response) => new CursoredData_1.CursoredData(response, Data_1.
|
|
46
|
-
USER_LIKES: (response) => new CursoredData_1.CursoredData(response, Data_1.
|
|
47
|
-
USER_MEDIA: (response) => new CursoredData_1.CursoredData(response, Data_1.
|
|
48
|
-
USER_NOTIFICATIONS: (response) => new CursoredData_1.CursoredData(response, Data_1.
|
|
49
|
-
USER_SUBSCRIPTIONS: (response) => new CursoredData_1.CursoredData(response, Data_1.
|
|
50
|
-
USER_TIMELINE: (response) => new CursoredData_1.CursoredData(response, Data_1.
|
|
51
|
-
USER_TIMELINE_AND_REPLIES: (response) => new CursoredData_1.CursoredData(response, Data_1.
|
|
43
|
+
USER_FOLLOWING: (response) => new CursoredData_1.CursoredData(response, Data_1.BaseType.USER),
|
|
44
|
+
USER_FOLLOWERS: (response) => new CursoredData_1.CursoredData(response, Data_1.BaseType.USER),
|
|
45
|
+
USER_HIGHLIGHTS: (response) => new CursoredData_1.CursoredData(response, Data_1.BaseType.TWEET),
|
|
46
|
+
USER_LIKES: (response) => new CursoredData_1.CursoredData(response, Data_1.BaseType.TWEET),
|
|
47
|
+
USER_MEDIA: (response) => new CursoredData_1.CursoredData(response, Data_1.BaseType.TWEET),
|
|
48
|
+
USER_NOTIFICATIONS: (response) => new CursoredData_1.CursoredData(response, Data_1.BaseType.NOTIFICATION),
|
|
49
|
+
USER_SUBSCRIPTIONS: (response) => new CursoredData_1.CursoredData(response, Data_1.BaseType.USER),
|
|
50
|
+
USER_TIMELINE: (response) => new CursoredData_1.CursoredData(response, Data_1.BaseType.TWEET),
|
|
51
|
+
USER_TIMELINE_AND_REPLIES: (response) => new CursoredData_1.CursoredData(response, Data_1.BaseType.TWEET),
|
|
52
52
|
USER_UNFOLLOW: (response) => (response?.id ? true : false),
|
|
53
53
|
/* eslint-enable @typescript-eslint/naming-convention */
|
|
54
54
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Extractors.js","sourceRoot":"","sources":["../../src/collections/Extractors.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"Extractors.js","sourceRoot":"","sources":["../../src/collections/Extractors.ts"],"names":[],"mappings":";;;AAAA,wCAAyC;AACzC,8DAA2D;AAE3D,gDAA6C;AAC7C,8CAA2C;AAoC3C;;;;GAIG;AACU,QAAA,UAAU,GAAG;IACzB,yDAAyD;IAEzD,YAAY,EAAE,CAAC,QAA8B,EAAsB,EAAE,CACpE,IAAI,2BAAY,CAAO,QAAQ,EAAE,eAAQ,CAAC,IAAI,CAAC;IAChD,WAAW,EAAE,CAAC,QAA6B,EAAuB,EAAE,CACnE,IAAI,2BAAY,CAAQ,QAAQ,EAAE,eAAQ,CAAC,KAAK,CAAC;IAElD,mBAAmB,EAAE,GAAS,EAAE,CAAC,SAAS;IAC1C,qBAAqB,EAAE,GAAS,EAAE,CAAC,SAAS;IAC5C,uBAAuB,EAAE,CAAC,QAAwC,EAAU,EAA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AQ,QAAQ,EAAE,eAAQ,CAAC,KAAK,CAAC;IAClD,aAAa,EAAE,CAAC,QAA+B,EAAW,EAAE,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,CAAC;IAE1F,wDAAwD;CACxD,CAAC"}
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { ResourceType } from '../enums/Resource';
|
|
2
2
|
/**
|
|
3
3
|
* Collection of resources that allow guest authentication.
|
|
4
4
|
*
|
|
5
5
|
* @internal
|
|
6
6
|
*/
|
|
7
|
-
export declare const
|
|
7
|
+
export declare const AllowGuestAuthenticationGroup: ResourceType[];
|
|
8
8
|
/**
|
|
9
9
|
* Collection of resources that can be fetched.
|
|
10
10
|
*
|
|
11
11
|
* @internal
|
|
12
12
|
*/
|
|
13
|
-
export declare const
|
|
13
|
+
export declare const FetchResourcesGroup: ResourceType[];
|
|
14
14
|
/**
|
|
15
15
|
* Collection of resources that can be posted.
|
|
16
16
|
*
|
|
17
17
|
* @internal
|
|
18
18
|
*/
|
|
19
|
-
export declare const
|
|
19
|
+
export declare const PostResourcesGroup: ResourceType[];
|
|
@@ -1,67 +1,67 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.PostResourcesGroup = exports.FetchResourcesGroup = exports.AllowGuestAuthenticationGroup = void 0;
|
|
4
4
|
const Resource_1 = require("../enums/Resource");
|
|
5
5
|
/**
|
|
6
6
|
* Collection of resources that allow guest authentication.
|
|
7
7
|
*
|
|
8
8
|
* @internal
|
|
9
9
|
*/
|
|
10
|
-
exports.
|
|
11
|
-
Resource_1.
|
|
12
|
-
Resource_1.
|
|
13
|
-
Resource_1.
|
|
10
|
+
exports.AllowGuestAuthenticationGroup = [
|
|
11
|
+
Resource_1.ResourceType.TWEET_DETAILS,
|
|
12
|
+
Resource_1.ResourceType.USER_DETAILS_BY_USERNAME,
|
|
13
|
+
Resource_1.ResourceType.USER_TIMELINE,
|
|
14
14
|
];
|
|
15
15
|
/**
|
|
16
16
|
* Collection of resources that can be fetched.
|
|
17
17
|
*
|
|
18
18
|
* @internal
|
|
19
19
|
*/
|
|
20
|
-
exports.
|
|
21
|
-
Resource_1.
|
|
22
|
-
Resource_1.
|
|
23
|
-
Resource_1.
|
|
24
|
-
Resource_1.
|
|
25
|
-
Resource_1.
|
|
26
|
-
Resource_1.
|
|
27
|
-
Resource_1.
|
|
28
|
-
Resource_1.
|
|
29
|
-
Resource_1.
|
|
30
|
-
Resource_1.
|
|
31
|
-
Resource_1.
|
|
32
|
-
Resource_1.
|
|
33
|
-
Resource_1.
|
|
34
|
-
Resource_1.
|
|
35
|
-
Resource_1.
|
|
36
|
-
Resource_1.
|
|
37
|
-
Resource_1.
|
|
38
|
-
Resource_1.
|
|
39
|
-
Resource_1.
|
|
40
|
-
Resource_1.
|
|
41
|
-
Resource_1.
|
|
42
|
-
Resource_1.
|
|
43
|
-
Resource_1.
|
|
44
|
-
Resource_1.
|
|
45
|
-
Resource_1.
|
|
20
|
+
exports.FetchResourcesGroup = [
|
|
21
|
+
Resource_1.ResourceType.LIST_MEMBERS,
|
|
22
|
+
Resource_1.ResourceType.LIST_TWEETS,
|
|
23
|
+
Resource_1.ResourceType.TWEET_DETAILS,
|
|
24
|
+
Resource_1.ResourceType.TWEET_DETAILS_ALT,
|
|
25
|
+
Resource_1.ResourceType.TWEET_DETAILS_BULK,
|
|
26
|
+
Resource_1.ResourceType.TWEET_LIKERS,
|
|
27
|
+
Resource_1.ResourceType.TWEET_REPLIES,
|
|
28
|
+
Resource_1.ResourceType.TWEET_RETWEETERS,
|
|
29
|
+
Resource_1.ResourceType.TWEET_SEARCH,
|
|
30
|
+
Resource_1.ResourceType.USER_AFFILIATES,
|
|
31
|
+
Resource_1.ResourceType.USER_BOOKMARKS,
|
|
32
|
+
Resource_1.ResourceType.USER_DETAILS_BY_USERNAME,
|
|
33
|
+
Resource_1.ResourceType.USER_DETAILS_BY_ID,
|
|
34
|
+
Resource_1.ResourceType.USER_DETAILS_BY_IDS_BULK,
|
|
35
|
+
Resource_1.ResourceType.USER_FEED_FOLLOWED,
|
|
36
|
+
Resource_1.ResourceType.USER_FEED_RECOMMENDED,
|
|
37
|
+
Resource_1.ResourceType.USER_FOLLOWING,
|
|
38
|
+
Resource_1.ResourceType.USER_FOLLOWERS,
|
|
39
|
+
Resource_1.ResourceType.USER_HIGHLIGHTS,
|
|
40
|
+
Resource_1.ResourceType.USER_LIKES,
|
|
41
|
+
Resource_1.ResourceType.USER_MEDIA,
|
|
42
|
+
Resource_1.ResourceType.USER_NOTIFICATIONS,
|
|
43
|
+
Resource_1.ResourceType.USER_SUBSCRIPTIONS,
|
|
44
|
+
Resource_1.ResourceType.USER_TIMELINE,
|
|
45
|
+
Resource_1.ResourceType.USER_TIMELINE_AND_REPLIES,
|
|
46
46
|
];
|
|
47
47
|
/**
|
|
48
48
|
* Collection of resources that can be posted.
|
|
49
49
|
*
|
|
50
50
|
* @internal
|
|
51
51
|
*/
|
|
52
|
-
exports.
|
|
53
|
-
Resource_1.
|
|
54
|
-
Resource_1.
|
|
55
|
-
Resource_1.
|
|
56
|
-
Resource_1.
|
|
57
|
-
Resource_1.
|
|
58
|
-
Resource_1.
|
|
59
|
-
Resource_1.
|
|
60
|
-
Resource_1.
|
|
61
|
-
Resource_1.
|
|
62
|
-
Resource_1.
|
|
63
|
-
Resource_1.
|
|
64
|
-
Resource_1.
|
|
65
|
-
Resource_1.
|
|
52
|
+
exports.PostResourcesGroup = [
|
|
53
|
+
Resource_1.ResourceType.MEDIA_UPLOAD_APPEND,
|
|
54
|
+
Resource_1.ResourceType.MEDIA_UPLOAD_FINALIZE,
|
|
55
|
+
Resource_1.ResourceType.MEDIA_UPLOAD_INITIALIZE,
|
|
56
|
+
Resource_1.ResourceType.TWEET_LIKE,
|
|
57
|
+
Resource_1.ResourceType.TWEET_POST,
|
|
58
|
+
Resource_1.ResourceType.TWEET_RETWEET,
|
|
59
|
+
Resource_1.ResourceType.TWEET_SCHEDULE,
|
|
60
|
+
Resource_1.ResourceType.TWEET_UNLIKE,
|
|
61
|
+
Resource_1.ResourceType.TWEET_UNPOST,
|
|
62
|
+
Resource_1.ResourceType.TWEET_UNRETWEET,
|
|
63
|
+
Resource_1.ResourceType.TWEET_UNSCHEDULE,
|
|
64
|
+
Resource_1.ResourceType.USER_FOLLOW,
|
|
65
|
+
Resource_1.ResourceType.USER_UNFOLLOW,
|
|
66
66
|
];
|
|
67
67
|
//# sourceMappingURL=Groups.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Groups.js","sourceRoot":"","sources":["../../src/collections/Groups.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"Groups.js","sourceRoot":"","sources":["../../src/collections/Groups.ts"],"names":[],"mappings":";;;AAAA,gDAAiD;AAEjD;;;;GAIG;AACU,QAAA,6BAA6B,GAAG;IAC5C,uBAAY,CAAC,aAAa;IAC1B,uBAAY,CAAC,wBAAwB;IACrC,uBAAY,CAAC,aAAa;CAC1B,CAAC;AAEF;;;;GAIG;AACU,QAAA,mBAAmB,GAAG;IAClC,uBAAY,CAAC,YAAY;IACzB,uBAAY,CAAC,WAAW;IACxB,uBAAY,CAAC,aAAa;IAC1B,uBAAY,CAAC,iBAAiB;IAC9B,uBAAY,CAAC,kBAAkB;IAC/B,uBAAY,CAAC,YAAY;IACzB,uBAAY,CAAC,aAAa;IAC1B,uBAAY,CAAC,gBAAgB;IAC7B,uBAAY,CAAC,YAAY;IACzB,uBAAY,CAAC,eAAe;IAC5B,uBAAY,CAAC,cAAc;IAC3B,uBAAY,CAAC,wBAAwB;IACrC,uBAAY,CAAC,kBAAkB;IAC/B,uBAAY,CAAC,wBAAwB;IACrC,uBAAY,CAAC,kBAAkB;IAC/B,uBAAY,CAAC,qBAAqB;IAClC,uBAAY,CAAC,cAAc;IAC3B,uBAAY,CAAC,cAAc;IAC3B,uBAAY,CAAC,eAAe;IAC5B,uBAAY,CAAC,UAAU;IACvB,uBAAY,CAAC,UAAU;IACvB,uBAAY,CAAC,kBAAkB;IAC/B,uBAAY,CAAC,kBAAkB;IAC/B,uBAAY,CAAC,aAAa;IAC1B,uBAAY,CAAC,yBAAyB;CACtC,CAAC;AAEF;;;;GAIG;AACU,QAAA,kBAAkB,GAAG;IACjC,uBAAY,CAAC,mBAAmB;IAChC,uBAAY,CAAC,qBAAqB;IAClC,uBAAY,CAAC,uBAAuB;IACpC,uBAAY,CAAC,UAAU;IACvB,uBAAY,CAAC,UAAU;IACvB,uBAAY,CAAC,aAAa;IAC1B,uBAAY,CAAC,cAAc;IAC3B,uBAAY,CAAC,YAAY;IACzB,uBAAY,CAAC,YAAY;IACzB,uBAAY,CAAC,eAAe;IAC5B,uBAAY,CAAC,gBAAgB;IAC7B,uBAAY,CAAC,WAAW;IACxB,uBAAY,CAAC,aAAa;CAC1B,CAAC"}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { AxiosRequestConfig } from 'axios';
|
|
2
|
-
import {
|
|
2
|
+
import { ResourceType } from '../enums/Resource';
|
|
3
3
|
import { IFetchArgs } from '../types/args/FetchArgs';
|
|
4
4
|
import { IPostArgs } from '../types/args/PostArgs';
|
|
5
5
|
/**
|
|
@@ -7,6 +7,6 @@ import { IPostArgs } from '../types/args/PostArgs';
|
|
|
7
7
|
*
|
|
8
8
|
* @internal
|
|
9
9
|
*/
|
|
10
|
-
export declare const
|
|
11
|
-
[key in keyof typeof
|
|
10
|
+
export declare const Requests: {
|
|
11
|
+
[key in keyof typeof ResourceType]: (args: IFetchArgs | IPostArgs) => AxiosRequestConfig;
|
|
12
12
|
};
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.Requests = void 0;
|
|
4
4
|
const List_1 = require("../requests/List");
|
|
5
5
|
const Media_1 = require("../requests/Media");
|
|
6
6
|
const Tweet_1 = require("../requests/Tweet");
|
|
@@ -11,7 +11,7 @@ const Tweet_2 = require("./Tweet");
|
|
|
11
11
|
*
|
|
12
12
|
* @internal
|
|
13
13
|
*/
|
|
14
|
-
exports.
|
|
14
|
+
exports.Requests = {
|
|
15
15
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
16
16
|
LIST_MEMBERS: (args) => List_1.ListRequests.members(args.id, args.count, args.cursor),
|
|
17
17
|
LIST_TWEETS: (args) => List_1.ListRequests.tweets(args.id, args.count, args.cursor),
|
|
@@ -24,7 +24,7 @@ exports.requests = {
|
|
|
24
24
|
TWEET_LIKE: (args) => Tweet_1.TweetRequests.like(args.id),
|
|
25
25
|
TWEET_LIKERS: (args) => Tweet_1.TweetRequests.likers(args.id, args.count, args.cursor),
|
|
26
26
|
TWEET_POST: (args) => Tweet_1.TweetRequests.post(args.tweet),
|
|
27
|
-
TWEET_REPLIES: (args) => Tweet_1.TweetRequests.replies(args.id, args.cursor, args.sortBy ? Tweet_2.
|
|
27
|
+
TWEET_REPLIES: (args) => Tweet_1.TweetRequests.replies(args.id, args.cursor, args.sortBy ? Tweet_2.TweetRepliesSortTypeMap[args.sortBy] : undefined),
|
|
28
28
|
TWEET_RETWEET: (args) => Tweet_1.TweetRequests.retweet(args.id),
|
|
29
29
|
TWEET_RETWEETERS: (args) => Tweet_1.TweetRequests.retweeters(args.id, args.count, args.cursor),
|
|
30
30
|
TWEET_SCHEDULE: (args) => Tweet_1.TweetRequests.schedule(args.tweet),
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Requests.js","sourceRoot":"","sources":["../../src/collections/Requests.ts"],"names":[],"mappings":";;;AAGA,2CAAgD;AAChD,6CAAkD;AAClD,6CAAkD;AAClD,2CAAgD;AAIhD,mCAAkD;AAElD;;;;GAIG;AACU,QAAA,QAAQ,
|
|
1
|
+
{"version":3,"file":"Requests.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AAC,IAAI,CAAC,EAAG,CAAC;IAEnE,wDAAwD;CACxD,CAAC"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { RawTweetRepliesSortType } from '../enums/raw/Tweet';
|
|
2
|
+
import { TweetRepliesSortType } from '../enums/Tweet';
|
|
3
3
|
/**
|
|
4
4
|
* Collection of mapping from parsed reply sort type to raw reply sort type.
|
|
5
5
|
*
|
|
6
6
|
* @internal
|
|
7
7
|
*/
|
|
8
|
-
export declare const
|
|
9
|
-
[key in keyof typeof
|
|
8
|
+
export declare const TweetRepliesSortTypeMap: {
|
|
9
|
+
[key in keyof typeof TweetRepliesSortType]: RawTweetRepliesSortType;
|
|
10
10
|
};
|
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.TweetRepliesSortTypeMap = void 0;
|
|
4
4
|
const Tweet_1 = require("../enums/raw/Tweet");
|
|
5
5
|
/**
|
|
6
6
|
* Collection of mapping from parsed reply sort type to raw reply sort type.
|
|
7
7
|
*
|
|
8
8
|
* @internal
|
|
9
9
|
*/
|
|
10
|
-
exports.
|
|
10
|
+
exports.TweetRepliesSortTypeMap = {
|
|
11
11
|
/* eslint-disable @typescript-eslint/naming-convention */
|
|
12
|
-
LATEST: Tweet_1.
|
|
13
|
-
LIKES: Tweet_1.
|
|
14
|
-
RELEVANCE: Tweet_1.
|
|
12
|
+
LATEST: Tweet_1.RawTweetRepliesSortType.LATEST,
|
|
13
|
+
LIKES: Tweet_1.RawTweetRepliesSortType.LIKES,
|
|
14
|
+
RELEVANCE: Tweet_1.RawTweetRepliesSortType.RELEVACE,
|
|
15
15
|
/* eslint-enable @typescript-eslint/naming-convention */
|
|
16
16
|
};
|
|
17
17
|
//# sourceMappingURL=Tweet.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Tweet.js","sourceRoot":"","sources":["../../src/collections/Tweet.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"Tweet.js","sourceRoot":"","sources":["../../src/collections/Tweet.ts"],"names":[],"mappings":";;;AAAA,8CAA6D;AAG7D;;;;GAIG;AACU,QAAA,uBAAuB,GAA4E;IAC/G,yDAAyD;IAEzD,MAAM,EAAE,+BAAuB,CAAC,MAAM;IACtC,KAAK,EAAE,+BAAuB,CAAC,KAAK;IACpC,SAAS,EAAE,+BAAuB,CAAC,QAAQ;IAE3C,wDAAwD;CACxD,CAAC"}
|
package/dist/commands/Tweet.js
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
const commander_1 = require("commander");
|
|
4
|
+
const Tweet_1 = require("../enums/Tweet");
|
|
4
5
|
const CliUtils_1 = require("../helper/CliUtils");
|
|
5
6
|
const FetchArgs_1 = require("../models/args/FetchArgs");
|
|
6
7
|
/**
|
|
@@ -59,8 +60,8 @@ function createTweetCommand(rettiwt) {
|
|
|
59
60
|
.argument('[cursor]', 'The cursor to the batch of likers to fetch')
|
|
60
61
|
.action(async (id, count, cursor) => {
|
|
61
62
|
try {
|
|
62
|
-
const
|
|
63
|
-
(0, CliUtils_1.output)(
|
|
63
|
+
const users = await rettiwt.tweet.likers(id, count ? parseInt(count) : undefined, cursor);
|
|
64
|
+
(0, CliUtils_1.output)(users);
|
|
64
65
|
}
|
|
65
66
|
catch (error) {
|
|
66
67
|
(0, CliUtils_1.output)(error);
|
|
@@ -88,6 +89,33 @@ function createTweetCommand(rettiwt) {
|
|
|
88
89
|
(0, CliUtils_1.output)(error);
|
|
89
90
|
}
|
|
90
91
|
});
|
|
92
|
+
// Replies
|
|
93
|
+
tweet
|
|
94
|
+
.command('replies')
|
|
95
|
+
.description('Fetch the list of replies to a tweet, with the first batch containing the whole thread, if the tweet is/part of a thread')
|
|
96
|
+
.argument('<id>', 'The id of the tweet')
|
|
97
|
+
.argument('[cursor]', 'The cursor to the batch of replies to fetch')
|
|
98
|
+
.option('-s, --sort-by <string>', 'Sort the tweets by likes, latest or relevance, default is latest')
|
|
99
|
+
.action(async (id, cursor, options) => {
|
|
100
|
+
try {
|
|
101
|
+
// Determining the sort type
|
|
102
|
+
let sortType = undefined;
|
|
103
|
+
if (options?.sortBy === 'likes') {
|
|
104
|
+
sortType = Tweet_1.TweetRepliesSortType.LIKES;
|
|
105
|
+
}
|
|
106
|
+
else if (options?.sortBy === 'latest') {
|
|
107
|
+
sortType = Tweet_1.TweetRepliesSortType.LATEST;
|
|
108
|
+
}
|
|
109
|
+
else if (options?.sortBy === 'relevance') {
|
|
110
|
+
sortType = Tweet_1.TweetRepliesSortType.RELEVANCE;
|
|
111
|
+
}
|
|
112
|
+
const tweets = await rettiwt.tweet.replies(id, cursor, sortType);
|
|
113
|
+
(0, CliUtils_1.output)(tweets);
|
|
114
|
+
}
|
|
115
|
+
catch (error) {
|
|
116
|
+
(0, CliUtils_1.output)(error);
|
|
117
|
+
}
|
|
118
|
+
});
|
|
91
119
|
// Retweet
|
|
92
120
|
tweet
|
|
93
121
|
.command('retweet')
|
|
@@ -111,8 +139,8 @@ function createTweetCommand(rettiwt) {
|
|
|
111
139
|
.argument('[cursor]', 'The cursor to the batch of retweeters to fetch')
|
|
112
140
|
.action(async (id, count, cursor) => {
|
|
113
141
|
try {
|
|
114
|
-
const
|
|
115
|
-
(0, CliUtils_1.output)(
|
|
142
|
+
const users = await rettiwt.tweet.retweeters(id, count ? parseInt(count) : undefined, cursor);
|
|
143
|
+
(0, CliUtils_1.output)(users);
|
|
116
144
|
}
|
|
117
145
|
catch (error) {
|
|
118
146
|
(0, CliUtils_1.output)(error);
|
|
@@ -161,8 +189,10 @@ function createTweetCommand(rettiwt) {
|
|
|
161
189
|
.option('-l, --min-likes <number>', 'Matches the tweets that have a minimum of given number of likes')
|
|
162
190
|
.option('-x, --min-retweets <number>', 'Matches the tweets that have a minimum of given number of retweets')
|
|
163
191
|
.option('-q, --quoted <string>', 'Matches the tweets that quote the tweet with the given id')
|
|
164
|
-
.option('--
|
|
165
|
-
.option('--
|
|
192
|
+
.option('--only-original', 'Matches tweets are original posts')
|
|
193
|
+
.option('--only-replies', 'Matches tweets that are replies')
|
|
194
|
+
.option('--only-text', 'Matches tweets that are only text')
|
|
195
|
+
.option('--only-links', 'Matches tweets that only contain links like media, quotes, etc')
|
|
166
196
|
.option('-s, --start <string>', 'Matches the tweets made since the given date (valid date/time string)')
|
|
167
197
|
.option('-e, --end <string>', 'Matches the tweets made upto the given date (valid date/time string)')
|
|
168
198
|
.option('--top', 'Matches top tweets instead of latest')
|
|
@@ -265,8 +295,6 @@ function createTweetCommand(rettiwt) {
|
|
|
265
295
|
*/
|
|
266
296
|
class TweetSearchOptions {
|
|
267
297
|
end;
|
|
268
|
-
excludeLinks = false;
|
|
269
|
-
excludeReplies = false;
|
|
270
298
|
excludeWords;
|
|
271
299
|
from;
|
|
272
300
|
hashtags;
|
|
@@ -276,6 +304,10 @@ class TweetSearchOptions {
|
|
|
276
304
|
minLikes;
|
|
277
305
|
minReplies;
|
|
278
306
|
minRetweets;
|
|
307
|
+
onlyLinks = false;
|
|
308
|
+
onlyOriginal = false;
|
|
309
|
+
onlyReplies = false;
|
|
310
|
+
onlyText = false;
|
|
279
311
|
optionalWords;
|
|
280
312
|
phrase;
|
|
281
313
|
quoted;
|
|
@@ -302,9 +334,11 @@ class TweetSearchOptions {
|
|
|
302
334
|
this.minReplies = options?.minReplies;
|
|
303
335
|
this.minLikes = options?.minLikes;
|
|
304
336
|
this.minRetweets = options?.minRetweets;
|
|
337
|
+
this.onlyLinks = options?.onlyLinks;
|
|
338
|
+
this.onlyOriginal = options?.onlyOriginal;
|
|
339
|
+
this.onlyReplies = options?.onlyReplies;
|
|
340
|
+
this.onlyText = options?.onlyText;
|
|
305
341
|
this.quoted = options?.quoted;
|
|
306
|
-
this.excludeLinks = options?.excludeLinks;
|
|
307
|
-
this.excludeReplies = options?.excludeReplies;
|
|
308
342
|
this.start = options?.start;
|
|
309
343
|
this.end = options?.end;
|
|
310
344
|
this.stream = options?.stream;
|
|
@@ -330,9 +364,11 @@ class TweetSearchOptions {
|
|
|
330
364
|
minReplies: this.minReplies,
|
|
331
365
|
minLikes: this.minLikes,
|
|
332
366
|
minRetweets: this.minRetweets,
|
|
367
|
+
onlyLinks: this.onlyLinks,
|
|
368
|
+
onlyOriginal: this.onlyOriginal,
|
|
369
|
+
onlyReplies: this.onlyReplies,
|
|
370
|
+
onlyText: this.onlyText,
|
|
333
371
|
quoted: this.quoted,
|
|
334
|
-
links: !this.excludeLinks,
|
|
335
|
-
replies: !this.excludeReplies,
|
|
336
372
|
startDate: this.start ? new Date(this.start) : undefined,
|
|
337
373
|
top: this.top,
|
|
338
374
|
endDate: this.end ? new Date(this.end) : undefined,
|