rettiwt-api 5.0.0-alpha.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 +6 -23
- package/dist/models/data/Tweet.js +93 -97
- 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 +28 -70
- 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 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserService.js","sourceRoot":"","sources":["../../../src/services/public/UserService.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"UserService.js","sourceRoot":"","sources":["../../../src/services/public/UserService.ts"],"names":[],"mappings":";;;AAkBA,6DAA0D;AAC1D,mDAAqD;AAOrD,qDAAkD;AAElD;;;;GAIG;AACH,MAAa,WAAY,SAAQ,+BAAc;IAC9C;;;;OAIG;IACH,YAAmB,MAAuB;QACzC,KAAK,CAAC,MAAM,CAAC,CAAC;IACf,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACI,KAAK,CAAC,SAAS,CAAC,KAAc,EAAE,MAAe;QACrD,MAAM,QAAQ,GAAG,wBAAa,CAAC,cAAc,CAAC;QAE9C,6BAA6B;QAC7B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAyB,QAAQ,EAAE;YACrE,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,MAAM;SACd,CAAC,CAAC;QAEH,yBAAyB;QACzB,MAAM,IAAI,GAAG,uBAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC;QAE5C,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4CG;IACI,KAAK,CAAC,OAAO,CAAC,EAAU;QAC9B,IAAI,QAAuB,CAAC;QAE5B,uBAAuB;QACvB,IAAI,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE,CAAC;YACvB,QAAQ,GAAG,wBAAa,CAAC,wBAAwB,CAAC;QACnD,CAAC;QACD,iBAAiB;aACZ,CAAC;YACL,QAAQ,GAAG,wBAAa,CAAC,kBAAkB,CAAC;QAC7C,CAAC;QAED,uBAAuB;QACvB,MAAM,QA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Q,CAAC,CAAC,QAAQ,CAAC,CAAC;QAE5C,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACI,KAAK,CAAC,QAAQ,CAAC,EAAU;QAC/B,MAAM,QAAQ,GAAG,wBAAa,CAAC,aAAa,CAAC;QAE7C,uBAAuB;QACvB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAwB,wBAAa,CAAC,aAAa,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QAEpG,6BAA6B;QAC7B,MAAM,IAAI,GAAG,uBAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC;QAErD,OAAO,IAAI,CAAC;IACb,CAAC;CACD;AA5qBD,kCA4qBC"}
|
|
@@ -29,4 +29,12 @@ export interface IRettiwtConfig {
|
|
|
29
29
|
logging?: boolean;
|
|
30
30
|
/** Optional custom error handler to define error conditions and process API/HTTP errors in responses. */
|
|
31
31
|
errorHandler?: IErrorHandler;
|
|
32
|
+
/**
|
|
33
|
+
* Optional custom HTTP headers to add to all requests to Twitter API.
|
|
34
|
+
*
|
|
35
|
+
* @remarks Custom headers can be useful for proxies, avoiding rate limits, etc.
|
|
36
|
+
*/
|
|
37
|
+
headers?: {
|
|
38
|
+
[key: string]: string;
|
|
39
|
+
};
|
|
32
40
|
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { ESearchResultType, ITweetFilter } from 'rettiwt-core';
|
|
2
|
+
/**
|
|
3
|
+
* Options specifying the data that is to be fetched.
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export interface IFetchArgs {
|
|
8
|
+
/**
|
|
9
|
+
* The number of data items to fetch.
|
|
10
|
+
*
|
|
11
|
+
* @remarks
|
|
12
|
+
* - Works only for cursored resources.
|
|
13
|
+
* - Does not work for {@link EResourceType.TWEET_REPLIES}.
|
|
14
|
+
* - Must be \<= 20 for:
|
|
15
|
+
* - {@link EResourceType.USER_TIMELINE}
|
|
16
|
+
* - {@link EResourceType.USER_TIMELINE}
|
|
17
|
+
* - {@link EResourceType.USER_TIMELINE_AND_REPLIES}
|
|
18
|
+
* - Must be \<= 100 for all other cursored resources.
|
|
19
|
+
* - Due a bug on Twitter's end, count does not work for {@link EResourceType.USER_FOLLOWERS} and {@link EResourceType.USER_FOLLOWING}.
|
|
20
|
+
* - Has not effect for:
|
|
21
|
+
* - {@link EResourceType.USER_FEED_FOLLOWED}
|
|
22
|
+
* - {@link EResourceType.USER_FEED_RECOMMENDED}
|
|
23
|
+
*/
|
|
24
|
+
count?: number;
|
|
25
|
+
/**
|
|
26
|
+
* The cursor to the batch of data to fetch.
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* - May be used for cursored resources.
|
|
30
|
+
* - Has no effect for other resources.
|
|
31
|
+
*/
|
|
32
|
+
cursor?: string;
|
|
33
|
+
/**
|
|
34
|
+
* The filter for searching tweets.
|
|
35
|
+
*
|
|
36
|
+
* @remarks
|
|
37
|
+
* Required when searching for tweets using {@link EResourceType.TWEET_SEARCH}.
|
|
38
|
+
*/
|
|
39
|
+
filter?: ITweetFilter;
|
|
40
|
+
/**
|
|
41
|
+
* The id of the target resource.
|
|
42
|
+
*
|
|
43
|
+
* @remarks
|
|
44
|
+
* - Required for all resources except {@link EResourceType.TWEET_SEARCH} and {@link EResourceType.USER_TIMELINE_RECOMMENDED}.
|
|
45
|
+
* - For {@link EResourceType.USER_DETAILS_BY_USERNAME}, can be alphanumeric, while for others, is strictly numeric.
|
|
46
|
+
*/
|
|
47
|
+
id?: string;
|
|
48
|
+
/**
|
|
49
|
+
* The type of search results to fetch. Can be one of:
|
|
50
|
+
* - {@link EResourceType.LATEST}, for latest search results.
|
|
51
|
+
* - {@link EResourceType.TOP}, for top search results.
|
|
52
|
+
*
|
|
53
|
+
* @defaultValue {@link ESearchResultType.LATEST}.
|
|
54
|
+
*
|
|
55
|
+
* @remarks
|
|
56
|
+
* - Applicable only for {@link EResourceType.TWEET_SEARCH}.
|
|
57
|
+
*/
|
|
58
|
+
results?: ESearchResultType;
|
|
59
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"FetchArgs.js","sourceRoot":"","sources":["../../../src/types/args/FetchArgs.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,56 @@
|
|
|
1
|
+
import { INewTweet } from 'rettiwt-core';
|
|
2
|
+
/**
|
|
3
|
+
* Options specifying the media file to be uploaded.
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export interface IUploadArgs {
|
|
8
|
+
/** The id allocated to the media file to be uploaded. */
|
|
9
|
+
id?: string;
|
|
10
|
+
/** The media file to be uploaded. */
|
|
11
|
+
media?: string | ArrayBuffer;
|
|
12
|
+
/**
|
|
13
|
+
* The size (in bytes) of the media file to be uploaded.
|
|
14
|
+
*
|
|
15
|
+
* @remarks The size must be \<= 5242880 bytes.
|
|
16
|
+
*/
|
|
17
|
+
size?: number;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* Options specifying the data that is to be posted.
|
|
21
|
+
*
|
|
22
|
+
* @public
|
|
23
|
+
*/
|
|
24
|
+
export interface IPostArgs {
|
|
25
|
+
/**
|
|
26
|
+
* The id of the target resource.
|
|
27
|
+
*
|
|
28
|
+
* @remarks
|
|
29
|
+
* Required only when posting using the following resources:
|
|
30
|
+
* - {@link EResourceType.TWEET_LIKE}
|
|
31
|
+
* - {@link EResourceType.TWEET_RETWEET}
|
|
32
|
+
* - {@link EResourceType.TWEET_UNLIKE}
|
|
33
|
+
* - {@link EResourceType.TWEET_UNPOST}
|
|
34
|
+
* - {@link EResourceType.TWEET_UNRETWEET}
|
|
35
|
+
* - {@link EResourceType.USER_FOLLOW}
|
|
36
|
+
* - {@link EResourceType.USER_UNFOLLOW}
|
|
37
|
+
*/
|
|
38
|
+
id?: string;
|
|
39
|
+
/**
|
|
40
|
+
* The tweet that is to be posted.
|
|
41
|
+
*
|
|
42
|
+
* @remarks
|
|
43
|
+
* Required only when posting a tweet using {@link EResourceType.TWEET_POST}
|
|
44
|
+
*/
|
|
45
|
+
tweet?: INewTweet;
|
|
46
|
+
/**
|
|
47
|
+
* The media file to be uploaded.
|
|
48
|
+
*
|
|
49
|
+
* @remarks
|
|
50
|
+
* Required only when uploading a media using the following resources:
|
|
51
|
+
* - {@link EResourceType.MEDIA_UPLOAD_APPEND}
|
|
52
|
+
* - {@link EResourceType.MEDIA_UPLOAD_FINALIZE}
|
|
53
|
+
* - {@link EResourceType.MEDIA_UPLOAD_INITIALIZE}
|
|
54
|
+
*/
|
|
55
|
+
upload?: IUploadArgs;
|
|
56
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"PostArgs.js","sourceRoot":"","sources":["../../../src/types/args/PostArgs.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The credentials of the Twitter account to be logged into.
|
|
3
|
+
*/
|
|
4
|
+
export interface IAccountCredential {
|
|
5
|
+
/** The email id associated with the Twitter account. */
|
|
6
|
+
email: string;
|
|
7
|
+
/** The password to the Twitter account. */
|
|
8
|
+
password: string;
|
|
9
|
+
/** The username associated with the Twitter account. */
|
|
10
|
+
userName: string;
|
|
11
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AccountCredential.js","sourceRoot":"","sources":["../../../src/types/auth/AccountCredential.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The cookie containing the tokens that are used to authenticate against Twitter.
|
|
3
|
+
*/
|
|
4
|
+
export interface IAuthCookie {
|
|
5
|
+
/** The bearer token from twitter.com. */
|
|
6
|
+
auth_token: string;
|
|
7
|
+
/** The CSRF token for the session. */
|
|
8
|
+
ct0: string;
|
|
9
|
+
/** Token used to authenticate a device. */
|
|
10
|
+
kdt: string;
|
|
11
|
+
/** Token used to authenticate a user using a Twitter ID. */
|
|
12
|
+
twid: string;
|
|
13
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthCookie.js","sourceRoot":"","sources":["../../../src/types/auth/AuthCookie.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { EAuthenticationType } from '../../enums/Authentication';
|
|
2
|
+
/**
|
|
3
|
+
* The credentials for authenticating against Twitter.
|
|
4
|
+
*
|
|
5
|
+
* Depending on which tokens are present, the authentication type is determined as follows:
|
|
6
|
+
* - authToken, guestToken =\> Guest authentication.
|
|
7
|
+
* - authToken, csrfToken, cookie =\> User authentication.
|
|
8
|
+
* - authToken, guestToken, cookie =\> Guest authentication while logging in.
|
|
9
|
+
*/
|
|
10
|
+
export interface IAuthCredential {
|
|
11
|
+
/** The bearer token from twitter.com. */
|
|
12
|
+
authToken?: string;
|
|
13
|
+
/** The type of authentication. */
|
|
14
|
+
authenticationType?: EAuthenticationType;
|
|
15
|
+
/** The cookie of the twitter account, which is used to authenticate against twitter. */
|
|
16
|
+
cookies?: string;
|
|
17
|
+
/** The CSRF token for the session. */
|
|
18
|
+
csrfToken?: string;
|
|
19
|
+
/** The guest token provided by Twitter API. */
|
|
20
|
+
guestToken?: string;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"AuthCredential.js","sourceRoot":"","sources":["../../../src/types/auth/AuthCredential.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { INotification } from './Notification';
|
|
2
|
+
import { ITweet } from './Tweet';
|
|
3
|
+
import { IUser } from './User';
|
|
4
|
+
/**
|
|
5
|
+
* The data that is fetched batch-wise using a cursor.
|
|
6
|
+
*
|
|
7
|
+
* @typeParam T - Type of data to be stored.
|
|
8
|
+
*
|
|
9
|
+
* @public
|
|
10
|
+
*/
|
|
11
|
+
export interface ICursoredData<T extends INotification | ITweet | IUser> {
|
|
12
|
+
/** The batch of data of the given type. */
|
|
13
|
+
list: T[];
|
|
14
|
+
/** The cursor to the next batch of data. */
|
|
15
|
+
next: ICursor;
|
|
16
|
+
}
|
|
17
|
+
/**
|
|
18
|
+
* The cursor to the batch of data to fetch.
|
|
19
|
+
*
|
|
20
|
+
* @public
|
|
21
|
+
*/
|
|
22
|
+
export interface ICursor {
|
|
23
|
+
/** The cursor string. */
|
|
24
|
+
value: string;
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"CursoredData.js","sourceRoot":"","sources":["../../../src/types/data/CursoredData.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The details of a single Twitter List.
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export interface IList {
|
|
7
|
+
/** The date and time of creation of the list, int UTC string format. */
|
|
8
|
+
createdAt: string;
|
|
9
|
+
/** The rest id of the user who created the list. */
|
|
10
|
+
createdBy: string;
|
|
11
|
+
/** The list description. */
|
|
12
|
+
description?: string;
|
|
13
|
+
/** The rest id of the list. */
|
|
14
|
+
id: string;
|
|
15
|
+
/** The number of memeber of the list. */
|
|
16
|
+
memberCount: number;
|
|
17
|
+
/** The name of the list. */
|
|
18
|
+
name: string;
|
|
19
|
+
/** The number of subscribers of the list. */
|
|
20
|
+
subscriberCount: number;
|
|
21
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"List.js","sourceRoot":"","sources":["../../../src/types/data/List.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { ENotificationType } from '../../enums/Data';
|
|
2
|
+
/**
|
|
3
|
+
* The details of a single notification.
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export interface INotification {
|
|
8
|
+
/** The list of id of the users from whom the notification was received. */
|
|
9
|
+
from: string[];
|
|
10
|
+
/** The id of the notification. */
|
|
11
|
+
id: string;
|
|
12
|
+
/** The text contents of the notification. */
|
|
13
|
+
message: string;
|
|
14
|
+
/** The date/time at which the notification was received. */
|
|
15
|
+
receivedAt: Date;
|
|
16
|
+
/** The list of id of the target tweet(s) of the notification. */
|
|
17
|
+
target: string[];
|
|
18
|
+
/** The type of notification. */
|
|
19
|
+
type?: ENotificationType;
|
|
20
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Notification.js","sourceRoot":"","sources":["../../../src/types/data/Notification.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,71 @@
|
|
|
1
|
+
import { EMediaType } from 'rettiwt-core';
|
|
2
|
+
import { IUser } from './User';
|
|
3
|
+
/**
|
|
4
|
+
* The details of a single tweet.
|
|
5
|
+
*
|
|
6
|
+
* @public
|
|
7
|
+
*/
|
|
8
|
+
export interface ITweet {
|
|
9
|
+
/** The number of bookmarks of a tweet. */
|
|
10
|
+
bookmarkCount: number;
|
|
11
|
+
/** The ID of tweet which started the current conversation. */
|
|
12
|
+
conversationId: string;
|
|
13
|
+
/** The date and time of creation of the tweet, in UTC string format. */
|
|
14
|
+
createdAt: string;
|
|
15
|
+
/** Additional tweet entities like urls, mentions, etc. */
|
|
16
|
+
entities: ITweetEntities;
|
|
17
|
+
/** The full text content of the tweet. */
|
|
18
|
+
fullText: string;
|
|
19
|
+
/** The rest id of the tweet. */
|
|
20
|
+
id: string;
|
|
21
|
+
/** The language in which the tweet is written. */
|
|
22
|
+
lang: string;
|
|
23
|
+
/** The number of likes of the tweet. */
|
|
24
|
+
likeCount: number;
|
|
25
|
+
/** The urls of the media contents of the tweet (if any). */
|
|
26
|
+
media?: ITweetMedia[];
|
|
27
|
+
/** The number of quotes of the tweet. */
|
|
28
|
+
quoteCount: number;
|
|
29
|
+
/** The tweet which is quoted in the tweet. */
|
|
30
|
+
quoted?: ITweet;
|
|
31
|
+
/** The number of replies to the tweet. */
|
|
32
|
+
replyCount: number;
|
|
33
|
+
/** The rest id of the tweet to which the tweet is a reply. */
|
|
34
|
+
replyTo?: string;
|
|
35
|
+
/** The number of retweets of the tweet. */
|
|
36
|
+
retweetCount: number;
|
|
37
|
+
/** The tweet which is retweeted in this tweet (if any). */
|
|
38
|
+
retweetedTweet?: ITweet;
|
|
39
|
+
/** The details of the user who made the tweet. */
|
|
40
|
+
tweetBy: IUser;
|
|
41
|
+
/** The URL to the tweet. */
|
|
42
|
+
url: string;
|
|
43
|
+
/** The number of views of a tweet. */
|
|
44
|
+
viewCount: number;
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* The different types parsed entities like urls, media, mentions, hashtags, etc.
|
|
48
|
+
*
|
|
49
|
+
* @public
|
|
50
|
+
*/
|
|
51
|
+
export interface ITweetEntities {
|
|
52
|
+
/** The list of hashtags mentioned in the tweet. */
|
|
53
|
+
hashtags: string[];
|
|
54
|
+
/** The list of IDs of users mentioned in the tweet. */
|
|
55
|
+
mentionedUsers: string[];
|
|
56
|
+
/** The list of urls mentioned in the tweet. */
|
|
57
|
+
urls: string[];
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* The details of a single media content included in a tweet.
|
|
61
|
+
*
|
|
62
|
+
* @public
|
|
63
|
+
*/
|
|
64
|
+
export interface ITweetMedia {
|
|
65
|
+
/** The thumbnail URL for the video content of the tweet. */
|
|
66
|
+
thumbnailUrl?: string;
|
|
67
|
+
/** The type of media. */
|
|
68
|
+
type: EMediaType;
|
|
69
|
+
/** The direct URL to the media. */
|
|
70
|
+
url: string;
|
|
71
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Tweet.js","sourceRoot":"","sources":["../../../src/types/data/Tweet.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The details of a single user.
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export interface IUser {
|
|
7
|
+
/** The creation date of user's account. */
|
|
8
|
+
createdAt: string;
|
|
9
|
+
/** The user's description. */
|
|
10
|
+
description?: string;
|
|
11
|
+
/** The number of followers of the user. */
|
|
12
|
+
followersCount: number;
|
|
13
|
+
/** The number of following of the user. */
|
|
14
|
+
followingsCount: number;
|
|
15
|
+
/** The full name of the user. */
|
|
16
|
+
fullName: string;
|
|
17
|
+
/** The rest id of the user. */
|
|
18
|
+
id: string;
|
|
19
|
+
/** Whether the account is verified or not. */
|
|
20
|
+
isVerified: boolean;
|
|
21
|
+
/** The number of tweets liked by the user. */
|
|
22
|
+
likeCount: number;
|
|
23
|
+
/** The location of user as provided by user. */
|
|
24
|
+
location?: string;
|
|
25
|
+
/** The rest id of the tweet pinned in the user's profile. */
|
|
26
|
+
pinnedTweet?: string;
|
|
27
|
+
/** The url of the profile banner image. */
|
|
28
|
+
profileBanner?: string;
|
|
29
|
+
/** The url of the profile image. */
|
|
30
|
+
profileImage: string;
|
|
31
|
+
/** The number of tweets made by the user. */
|
|
32
|
+
statusesCount: number;
|
|
33
|
+
/** The username/screenname of the user. */
|
|
34
|
+
userName: string;
|
|
35
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"User.js","sourceRoot":"","sources":["../../../src/types/data/User.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { FlatCompat } from '@eslint/eslintrc';
|
|
2
|
+
import path from 'path';
|
|
3
|
+
import { fileURLToPath } from 'url';
|
|
4
|
+
|
|
5
|
+
const __filename = fileURLToPath(import.meta.url);
|
|
6
|
+
const __dirname = path.dirname(__filename);
|
|
7
|
+
|
|
8
|
+
const compat = new FlatCompat({
|
|
9
|
+
baseDirectory: __dirname,
|
|
10
|
+
});
|
|
11
|
+
|
|
12
|
+
export default [
|
|
13
|
+
{
|
|
14
|
+
ignores: ['dist/', 'node_modules/', 'docs/'],
|
|
15
|
+
},
|
|
16
|
+
...compat.extends('.eslintrc.js'),
|
|
17
|
+
];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rettiwt-api",
|
|
3
|
-
"version": "5.0.0-alpha.
|
|
3
|
+
"version": "5.0.0-alpha.1",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"description": "An API for fetching data from TwitterAPI, without any rate limits!",
|
|
@@ -28,25 +28,28 @@
|
|
|
28
28
|
"url": "https://github.com/Rishikant181/Rettiwt-API/issues"
|
|
29
29
|
},
|
|
30
30
|
"homepage": "https://rishikant181.github.io/Rettiwt-API/",
|
|
31
|
-
"
|
|
32
|
-
"
|
|
33
|
-
"chalk": "4.1.2",
|
|
34
|
-
"class-validator": "0.14.1",
|
|
35
|
-
"commander": "11.1.0",
|
|
36
|
-
"https-proxy-agent": "7.0.2",
|
|
37
|
-
"rettiwt-auth": "2.1.0",
|
|
38
|
-
"rettiwt-core": "4.4.0"
|
|
31
|
+
"engines": {
|
|
32
|
+
"node": "^22.13.1"
|
|
39
33
|
},
|
|
40
34
|
"devDependencies": {
|
|
41
|
-
"@types/
|
|
42
|
-
"@
|
|
43
|
-
"@typescript-eslint/
|
|
44
|
-
"eslint": "8.
|
|
45
|
-
"eslint
|
|
46
|
-
"eslint-plugin-
|
|
47
|
-
"
|
|
48
|
-
"
|
|
49
|
-
"
|
|
50
|
-
"
|
|
35
|
+
"@types/cookiejar": "2.1.5",
|
|
36
|
+
"@types/node": "22.13.1",
|
|
37
|
+
"@typescript-eslint/eslint-plugin": "8.24.0",
|
|
38
|
+
"@typescript-eslint/parser": "8.24.0",
|
|
39
|
+
"eslint": "9.20.1",
|
|
40
|
+
"eslint-plugin-import": "2.31.0",
|
|
41
|
+
"eslint-plugin-tsdoc": "0.4.0",
|
|
42
|
+
"nodemon": "3.1.9",
|
|
43
|
+
"prettier": "3.5.1",
|
|
44
|
+
"typedoc": "0.27.7",
|
|
45
|
+
"typescript": "5.7.3"
|
|
46
|
+
},
|
|
47
|
+
"dependencies": {
|
|
48
|
+
"axios": "1.8.4",
|
|
49
|
+
"chalk": "5.4.1",
|
|
50
|
+
"commander": "13.1.0",
|
|
51
|
+
"cookiejar": "2.1.4",
|
|
52
|
+
"https-proxy-agent": "7.0.6",
|
|
53
|
+
"rettiwt-core": "4.5.0-alpha.3"
|
|
51
54
|
}
|
|
52
55
|
}
|
package/src/Rettiwt.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { AuthService } from './services/
|
|
1
|
+
import { AuthService } from './services/internal/AuthService';
|
|
2
2
|
import { ListService } from './services/public/ListService';
|
|
3
3
|
import { TweetService } from './services/public/TweetService';
|
|
4
4
|
import { UserService } from './services/public/UserService';
|
package/src/cli.ts
CHANGED
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
|
|
3
3
|
import { createCommand } from 'commander';
|
|
4
4
|
|
|
5
|
-
import auth from './commands/Auth';
|
|
6
5
|
import list from './commands/List';
|
|
7
6
|
import tweet from './commands/Tweet';
|
|
8
7
|
import user from './commands/User';
|
|
@@ -36,7 +35,6 @@ const rettiwt: Rettiwt = new Rettiwt({
|
|
|
36
35
|
program.addCommand(list(rettiwt));
|
|
37
36
|
program.addCommand(tweet(rettiwt));
|
|
38
37
|
program.addCommand(user(rettiwt));
|
|
39
|
-
program.addCommand(auth(rettiwt));
|
|
40
38
|
|
|
41
39
|
// Finalizing the CLI
|
|
42
40
|
program.parse();
|
|
@@ -59,6 +59,8 @@ export const extractors = {
|
|
|
59
59
|
TWEET_LIKE: (response: ITweetLikeResponse): boolean => (response?.data?.favorite_tweet ? true : false),
|
|
60
60
|
TWEET_POST: (response: ITweetPostResponse): string =>
|
|
61
61
|
response?.data?.create_tweet?.tweet_results?.result?.rest_id ?? undefined,
|
|
62
|
+
TWEET_REPLIES: (response: ITweetDetailsResponse): CursoredData<Tweet> =>
|
|
63
|
+
new CursoredData<Tweet>(response, EBaseType.TWEET),
|
|
62
64
|
TWEET_RETWEET: (response: ITweetRetweetResponse): boolean => (response?.data?.create_retweet ? true : false),
|
|
63
65
|
TWEET_RETWEETERS: (response: ITweetRetweetersResponse): CursoredData<User> =>
|
|
64
66
|
new CursoredData<User>(response, EBaseType.USER),
|