rettiwt-api 2.4.2 → 2.5.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 +5 -0
- package/.github/workflows/documentation.yml +1 -1
- package/.github/workflows/publish.yml +1 -1
- package/.prettierrc +1 -1
- package/README.md +69 -19
- package/dist/Rettiwt.d.ts +7 -4
- package/dist/Rettiwt.js +4 -2
- package/dist/Rettiwt.js.map +1 -1
- package/dist/cli.js +4 -2
- package/dist/cli.js.map +1 -1
- package/dist/commands/Auth.d.ts +2 -1
- package/dist/commands/Auth.js +10 -17
- package/dist/commands/Auth.js.map +1 -1
- package/dist/commands/Tweet.js +36 -3
- package/dist/commands/Tweet.js.map +1 -1
- package/dist/enums/{ApiErrors.js → Api.js} +1 -1
- package/dist/enums/Api.js.map +1 -0
- package/dist/enums/Http.d.ts +68 -0
- package/dist/enums/Http.js +73 -0
- package/dist/enums/Http.js.map +1 -0
- package/dist/enums/Logging.d.ts +1 -0
- package/dist/enums/Logging.js +1 -0
- package/dist/enums/Logging.js.map +1 -1
- package/dist/index.d.ts +15 -14
- package/dist/index.js +22 -17
- package/dist/index.js.map +1 -1
- package/dist/models/args/TweetArgs.d.ts +44 -0
- package/dist/models/args/TweetArgs.js +82 -0
- package/dist/models/args/TweetArgs.js.map +1 -0
- package/dist/models/{public → data}/CursoredData.d.ts +5 -3
- package/dist/models/{public → data}/CursoredData.js +1 -0
- package/dist/models/data/CursoredData.js.map +1 -0
- package/dist/{types/public → models/data}/List.d.ts +8 -1
- package/dist/models/data/List.js.map +1 -0
- package/dist/models/data/Media.d.ts +14 -0
- package/dist/models/data/Media.js +19 -0
- package/dist/models/data/Media.js.map +1 -0
- package/dist/{types/public → models/data}/Tweet.d.ts +26 -8
- package/dist/models/{public → data}/Tweet.js +4 -0
- package/dist/models/data/Tweet.js.map +1 -0
- package/dist/{types/public → models/data}/User.d.ts +8 -1
- package/dist/models/data/User.js.map +1 -0
- package/dist/models/errors/ApiError.d.ts +17 -0
- package/dist/models/errors/ApiError.js +42 -0
- package/dist/models/errors/ApiError.js.map +1 -0
- package/dist/models/errors/HttpError.d.ts +17 -0
- package/dist/models/errors/HttpError.js +42 -0
- package/dist/models/errors/HttpError.js.map +1 -0
- package/dist/models/errors/RettiwtError.d.ts +8 -0
- package/dist/models/errors/RettiwtError.js +34 -0
- package/dist/models/errors/RettiwtError.js.map +1 -0
- package/dist/models/errors/TimeoutError.d.ts +14 -0
- package/dist/models/errors/TimeoutError.js +39 -0
- package/dist/models/errors/TimeoutError.js.map +1 -0
- package/dist/services/internal/ErrorService.d.ts +85 -0
- package/dist/services/internal/ErrorService.js +144 -0
- package/dist/services/internal/ErrorService.js.map +1 -0
- package/dist/services/internal/FetcherService.d.ts +22 -24
- package/dist/services/internal/FetcherService.js +79 -59
- package/dist/services/internal/FetcherService.js.map +1 -1
- package/dist/services/public/AuthService.d.ts +66 -0
- package/dist/services/public/AuthService.js +160 -0
- package/dist/services/public/AuthService.js.map +1 -0
- package/dist/services/public/TweetService.d.ts +27 -8
- package/dist/services/public/TweetService.js +45 -8
- package/dist/services/public/TweetService.js.map +1 -1
- package/dist/services/public/UserService.d.ts +5 -5
- package/dist/services/public/UserService.js.map +1 -1
- package/dist/types/ErrorHandler.d.ts +13 -0
- package/dist/types/{public/User.js → ErrorHandler.js} +1 -1
- package/dist/types/ErrorHandler.js.map +1 -0
- package/dist/types/RettiwtConfig.d.ts +32 -0
- package/dist/types/RettiwtConfig.js.map +1 -0
- package/package.json +6 -5
- package/src/Rettiwt.ts +10 -5
- package/src/cli.ts +4 -2
- package/src/commands/Auth.ts +5 -16
- package/src/commands/Tweet.ts +56 -3
- package/src/enums/Http.ts +68 -0
- package/src/enums/Logging.ts +1 -0
- package/src/index.ts +25 -18
- package/src/models/args/TweetArgs.ts +98 -0
- package/src/models/{public → data}/CursoredData.ts +6 -5
- package/src/models/{public → data}/List.ts +14 -4
- package/src/models/data/Media.ts +19 -0
- package/src/models/{public → data}/Tweet.ts +39 -5
- package/src/models/{public → data}/User.ts +28 -4
- package/src/models/errors/ApiError.ts +24 -0
- package/src/models/errors/HttpError.ts +24 -0
- package/src/models/errors/RettiwtError.ts +12 -0
- package/src/models/errors/TimeoutError.ts +18 -0
- package/src/services/internal/ErrorService.ts +158 -0
- package/src/services/internal/FetcherService.ts +94 -80
- package/src/services/public/AuthService.ts +97 -0
- package/src/services/public/TweetService.ts +48 -10
- package/src/services/public/UserService.ts +7 -5
- package/src/types/ErrorHandler.ts +13 -0
- package/src/types/RettiwtConfig.ts +40 -0
- package/dist/enums/ApiErrors.js.map +0 -1
- package/dist/enums/HTTP.d.ts +0 -17
- package/dist/enums/HTTP.js +0 -22
- package/dist/enums/HTTP.js.map +0 -1
- package/dist/models/internal/RettiwtConfig.d.ts +0 -18
- package/dist/models/internal/RettiwtConfig.js +0 -24
- package/dist/models/internal/RettiwtConfig.js.map +0 -1
- package/dist/models/public/CursoredData.js.map +0 -1
- package/dist/models/public/List.d.ts +0 -22
- package/dist/models/public/List.js.map +0 -1
- package/dist/models/public/Tweet.d.ts +0 -62
- package/dist/models/public/Tweet.js.map +0 -1
- package/dist/models/public/User.d.ts +0 -29
- package/dist/models/public/User.js.map +0 -1
- package/dist/types/internal/RettiwtConfig.d.ts +0 -15
- package/dist/types/internal/RettiwtConfig.js.map +0 -1
- package/dist/types/public/CursoredData.d.ts +0 -22
- package/dist/types/public/CursoredData.js +0 -3
- package/dist/types/public/CursoredData.js.map +0 -1
- package/dist/types/public/List.js +0 -3
- package/dist/types/public/List.js.map +0 -1
- package/dist/types/public/Tweet.js +0 -3
- package/dist/types/public/Tweet.js.map +0 -1
- package/dist/types/public/User.js.map +0 -1
- package/src/enums/HTTP.ts +0 -17
- package/src/models/internal/RettiwtConfig.ts +0 -26
- package/src/types/internal/RettiwtConfig.ts +0 -18
- package/src/types/public/CursoredData.ts +0 -24
- package/src/types/public/List.ts +0 -27
- package/src/types/public/Tweet.ts +0 -86
- package/src/types/public/User.ts +0 -48
- /package/dist/enums/{ApiErrors.d.ts → Api.d.ts} +0 -0
- /package/dist/models/{public → data}/List.js +0 -0
- /package/dist/models/{public → data}/User.js +0 -0
- /package/dist/types/{internal/RettiwtConfig.js → RettiwtConfig.js} +0 -0
- /package/src/enums/{ApiErrors.ts → Api.ts} +0 -0
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The data that us fetched batch-wise along with a cursor.
|
|
3
|
-
*
|
|
4
|
-
* @typeParam T - Type of data present in the list.
|
|
5
|
-
*
|
|
6
|
-
* @public
|
|
7
|
-
*/
|
|
8
|
-
export interface ICursoredData<T> {
|
|
9
|
-
/** The list of data of the given type. */
|
|
10
|
-
list: T[];
|
|
11
|
-
|
|
12
|
-
/** The cursor to the next batch of data. */
|
|
13
|
-
next: ICursor;
|
|
14
|
-
}
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* The cursor to the batch of data to be fetched.
|
|
18
|
-
*
|
|
19
|
-
* @public
|
|
20
|
-
*/
|
|
21
|
-
export interface ICursor {
|
|
22
|
-
/** The cursor string. */
|
|
23
|
-
value: string;
|
|
24
|
-
}
|
package/src/types/public/List.ts
DELETED
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The details of a single Twitter List.
|
|
3
|
-
*
|
|
4
|
-
* @public
|
|
5
|
-
*/
|
|
6
|
-
export interface IList {
|
|
7
|
-
/** The rest id of the list. */
|
|
8
|
-
id: string;
|
|
9
|
-
|
|
10
|
-
/** The name of the list. */
|
|
11
|
-
name: string;
|
|
12
|
-
|
|
13
|
-
/** The date and time of creation of the list, int UTC string format. */
|
|
14
|
-
createdAt: string;
|
|
15
|
-
|
|
16
|
-
/** The list description. */
|
|
17
|
-
description: string;
|
|
18
|
-
|
|
19
|
-
/** The number of memeber of the list. */
|
|
20
|
-
memberCount: number;
|
|
21
|
-
|
|
22
|
-
/** The number of subscribers of the list. */
|
|
23
|
-
subscriberCount: number;
|
|
24
|
-
|
|
25
|
-
/** The rest id of the user who created the list. */
|
|
26
|
-
createdBy: string;
|
|
27
|
-
}
|
|
@@ -1,86 +0,0 @@
|
|
|
1
|
-
// PACKAGES
|
|
2
|
-
import { EMediaType } from 'rettiwt-core';
|
|
3
|
-
|
|
4
|
-
// TYPES
|
|
5
|
-
import { IUser } from './User';
|
|
6
|
-
|
|
7
|
-
/**
|
|
8
|
-
* The details of a single Tweet.
|
|
9
|
-
*
|
|
10
|
-
* @public
|
|
11
|
-
*/
|
|
12
|
-
export interface ITweet {
|
|
13
|
-
/** The rest id of the tweet. */
|
|
14
|
-
id: string;
|
|
15
|
-
|
|
16
|
-
/** The details of the user who made the tweet. */
|
|
17
|
-
tweetBy: IUser;
|
|
18
|
-
|
|
19
|
-
/** The date and time of creation of the tweet, in UTC string format. */
|
|
20
|
-
createdAt: string;
|
|
21
|
-
|
|
22
|
-
/** Additional tweet entities like urls, mentions, etc. */
|
|
23
|
-
entities: ITweetEntities;
|
|
24
|
-
|
|
25
|
-
/** The urls of the media contents of the tweet (if any). */
|
|
26
|
-
media: ITweetMedia[];
|
|
27
|
-
|
|
28
|
-
/** The rest id of the tweet which is quoted in the tweet. */
|
|
29
|
-
quoted: string;
|
|
30
|
-
|
|
31
|
-
/** The full text content of the tweet. */
|
|
32
|
-
fullText: string;
|
|
33
|
-
|
|
34
|
-
/** The rest id of the user to which the tweet is a reply. */
|
|
35
|
-
replyTo: string;
|
|
36
|
-
|
|
37
|
-
/** The language in which the tweet is written. */
|
|
38
|
-
lang: string;
|
|
39
|
-
|
|
40
|
-
/** The number of quotes of the tweet. */
|
|
41
|
-
quoteCount: number;
|
|
42
|
-
|
|
43
|
-
/** The number of replies to the tweet. */
|
|
44
|
-
replyCount: number;
|
|
45
|
-
|
|
46
|
-
/** The number of retweets of the tweet. */
|
|
47
|
-
retweetCount: number;
|
|
48
|
-
|
|
49
|
-
/** The number of likes of the tweet. */
|
|
50
|
-
likeCount: number;
|
|
51
|
-
|
|
52
|
-
/** The number of views of a tweet. */
|
|
53
|
-
viewCount: number;
|
|
54
|
-
|
|
55
|
-
/** The number of bookmarks of a tweet. */
|
|
56
|
-
bookmarkCount: number;
|
|
57
|
-
}
|
|
58
|
-
|
|
59
|
-
/**
|
|
60
|
-
* The different types parsed entities like urls, media, mentions, hashtags, etc.
|
|
61
|
-
*
|
|
62
|
-
* @public
|
|
63
|
-
*/
|
|
64
|
-
export interface ITweetEntities {
|
|
65
|
-
/** The list of hashtags mentioned in the tweet. */
|
|
66
|
-
hashtags: string[];
|
|
67
|
-
|
|
68
|
-
/** The list of urls mentioned in the tweet. */
|
|
69
|
-
urls: string[];
|
|
70
|
-
|
|
71
|
-
/** The list of IDs of users mentioned in the tweet. */
|
|
72
|
-
mentionedUsers: string[];
|
|
73
|
-
}
|
|
74
|
-
|
|
75
|
-
/**
|
|
76
|
-
* A single media content.
|
|
77
|
-
*
|
|
78
|
-
* @public
|
|
79
|
-
*/
|
|
80
|
-
export interface ITweetMedia {
|
|
81
|
-
/** The type of media. */
|
|
82
|
-
type: EMediaType;
|
|
83
|
-
|
|
84
|
-
/** The direct URL to the media. */
|
|
85
|
-
url: string;
|
|
86
|
-
}
|
package/src/types/public/User.ts
DELETED
|
@@ -1,48 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The details of a single user.
|
|
3
|
-
*
|
|
4
|
-
* @public
|
|
5
|
-
*/
|
|
6
|
-
export interface IUser {
|
|
7
|
-
/** The rest id of the user. */
|
|
8
|
-
id: string;
|
|
9
|
-
|
|
10
|
-
/** The username/screenname of the user. */
|
|
11
|
-
userName: string;
|
|
12
|
-
|
|
13
|
-
/** The full name of the user. */
|
|
14
|
-
fullName: string;
|
|
15
|
-
|
|
16
|
-
/** The creation date of user's account. */
|
|
17
|
-
createdAt: string;
|
|
18
|
-
|
|
19
|
-
/** The user's description. */
|
|
20
|
-
description: string;
|
|
21
|
-
|
|
22
|
-
/** Whether the account is verified or not. */
|
|
23
|
-
isVerified: boolean;
|
|
24
|
-
|
|
25
|
-
/** The number of tweets liked by the user. */
|
|
26
|
-
favouritesCount: number;
|
|
27
|
-
|
|
28
|
-
/** The number of followers of the user. */
|
|
29
|
-
followersCount: number;
|
|
30
|
-
|
|
31
|
-
/** The number of following of the user. */
|
|
32
|
-
followingsCount: number;
|
|
33
|
-
|
|
34
|
-
/** The number of tweets made by the user. */
|
|
35
|
-
statusesCount: number;
|
|
36
|
-
|
|
37
|
-
/** The location of user as provided by user. */
|
|
38
|
-
location: string;
|
|
39
|
-
|
|
40
|
-
/** The rest id of the tweet pinned in the user's profile. */
|
|
41
|
-
pinnedTweet: string;
|
|
42
|
-
|
|
43
|
-
/** The url of the profile banner image. */
|
|
44
|
-
profileBanner: string;
|
|
45
|
-
|
|
46
|
-
/** The url of the profile image. */
|
|
47
|
-
profileImage: string;
|
|
48
|
-
}
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|