rettiwt-api 6.0.7 → 6.1.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/.github/ISSUE_TEMPLATE/bug-report.yml +57 -0
- package/.github/ISSUE_TEMPLATE/feature-request.yml +20 -0
- package/.github/ISSUE_TEMPLATE/question.yml +15 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +32 -0
- package/.github/workflows/ci.yml +33 -0
- package/.nvmrc +1 -0
- package/README.md +30 -6
- package/dist/Rettiwt.d.ts +3 -0
- package/dist/Rettiwt.js +4 -0
- package/dist/Rettiwt.js.map +1 -1
- package/dist/cli.js +2 -0
- package/dist/cli.js.map +1 -1
- package/dist/collections/Extractors.d.ts +24 -0
- package/dist/collections/Extractors.js +14 -0
- package/dist/collections/Extractors.js.map +1 -1
- package/dist/collections/Groups.js +11 -0
- package/dist/collections/Groups.js.map +1 -1
- package/dist/collections/Requests.js +12 -0
- package/dist/collections/Requests.js.map +1 -1
- package/dist/commands/DirectMessage.d.ts +10 -0
- package/dist/commands/DirectMessage.js +57 -0
- package/dist/commands/DirectMessage.js.map +1 -0
- package/dist/commands/List.js +44 -3
- package/dist/commands/List.js.map +1 -1
- package/dist/commands/Tweet.js +29 -1
- package/dist/commands/Tweet.js.map +1 -1
- package/dist/commands/User.js +39 -1
- package/dist/commands/User.js.map +1 -1
- package/dist/enums/Data.d.ts +3 -1
- package/dist/enums/Data.js +2 -0
- package/dist/enums/Data.js.map +1 -1
- package/dist/enums/Resource.d.ts +11 -0
- package/dist/enums/Resource.js +12 -0
- package/dist/enums/Resource.js.map +1 -1
- package/dist/enums/raw/Analytics.d.ts +6 -3
- package/dist/enums/raw/Analytics.js +5 -2
- package/dist/enums/raw/Analytics.js.map +1 -1
- package/dist/index.d.ts +15 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/models/args/FetchArgs.d.ts +9 -0
- package/dist/models/args/FetchArgs.js +16 -0
- package/dist/models/args/FetchArgs.js.map +1 -1
- package/dist/models/args/PostArgs.d.ts +1 -0
- package/dist/models/args/PostArgs.js +2 -0
- package/dist/models/args/PostArgs.js.map +1 -1
- package/dist/models/data/Analytics.d.ts +43 -0
- package/dist/models/data/Analytics.js +92 -0
- package/dist/models/data/Analytics.js.map +1 -0
- package/dist/models/data/Conversation.d.ts +93 -0
- package/dist/models/data/Conversation.js +293 -0
- package/dist/models/data/Conversation.js.map +1 -0
- package/dist/models/data/CursoredData.d.ts +2 -1
- package/dist/models/data/CursoredData.js +6 -1
- package/dist/models/data/CursoredData.js.map +1 -1
- package/dist/models/data/DirectMessage.d.ts +105 -0
- package/dist/models/data/DirectMessage.js +284 -0
- package/dist/models/data/DirectMessage.js.map +1 -0
- package/dist/models/data/Inbox.d.ts +44 -0
- package/dist/models/data/Inbox.js +106 -0
- package/dist/models/data/Inbox.js.map +1 -0
- package/dist/models/data/List.d.ts +20 -0
- package/dist/models/data/List.js +50 -1
- package/dist/models/data/List.js.map +1 -1
- package/dist/models/data/Tweet.d.ts +6 -6
- package/dist/models/data/Tweet.js +4 -2
- package/dist/models/data/Tweet.js.map +1 -1
- package/dist/models/data/User.d.ts +2 -0
- package/dist/models/data/User.js +6 -0
- package/dist/models/data/User.js.map +1 -1
- package/dist/requests/DirectMessage.d.ts +28 -0
- package/dist/requests/DirectMessage.js +149 -0
- package/dist/requests/DirectMessage.js.map +1 -0
- package/dist/requests/List.d.ts +10 -0
- package/dist/requests/List.js +52 -0
- package/dist/requests/List.js.map +1 -1
- package/dist/requests/Tweet.d.ts +8 -0
- package/dist/requests/Tweet.js +30 -0
- package/dist/requests/Tweet.js.map +1 -1
- package/dist/requests/User.d.ts +8 -1
- package/dist/requests/User.js +67 -8
- package/dist/requests/User.js.map +1 -1
- package/dist/services/public/DirectMessageService.d.ts +100 -0
- package/dist/services/public/DirectMessageService.js +143 -0
- package/dist/services/public/DirectMessageService.js.map +1 -0
- package/dist/services/public/FetcherService.d.ts +3 -2
- package/dist/services/public/FetcherService.js +64 -3
- package/dist/services/public/FetcherService.js.map +1 -1
- package/dist/services/public/ListService.d.ts +85 -0
- package/dist/services/public/ListService.js +111 -0
- package/dist/services/public/ListService.js.map +1 -1
- package/dist/services/public/TweetService.d.ts +56 -0
- package/dist/services/public/TweetService.js +72 -0
- package/dist/services/public/TweetService.js.map +1 -1
- package/dist/services/public/UserService.d.ts +61 -2
- package/dist/services/public/UserService.js +89 -0
- package/dist/services/public/UserService.js.map +1 -1
- package/dist/types/args/FetchArgs.d.ts +69 -12
- package/dist/types/args/PostArgs.d.ts +29 -11
- package/dist/types/data/Analytics.d.ts +42 -0
- package/dist/types/data/Analytics.js +3 -0
- package/dist/types/data/Analytics.js.map +1 -0
- package/dist/types/data/Conversation.d.ts +32 -0
- package/dist/types/data/Conversation.js +3 -0
- package/dist/types/data/Conversation.js.map +1 -0
- package/dist/types/data/CursoredData.d.ts +4 -1
- package/dist/types/data/DirectMessage.d.ts +25 -0
- package/dist/types/data/DirectMessage.js +3 -0
- package/dist/types/data/DirectMessage.js.map +1 -0
- package/dist/types/data/Inbox.d.ts +18 -0
- package/dist/types/data/Inbox.js +3 -0
- package/dist/types/data/Inbox.js.map +1 -0
- package/dist/types/data/List.d.ts +5 -1
- package/dist/types/data/Tweet.d.ts +6 -6
- package/dist/types/data/User.d.ts +4 -0
- package/dist/types/raw/base/Analytic.d.ts +6 -1
- package/dist/types/raw/base/Message.d.ts +16 -0
- package/dist/types/raw/base/Message.js +4 -0
- package/dist/types/raw/base/Message.js.map +1 -0
- package/dist/types/raw/base/Tweet.d.ts +6 -6
- package/dist/types/raw/base/User.d.ts +2 -1
- package/dist/types/raw/composite/TimelineList.d.ts +9 -0
- package/dist/types/raw/composite/TimelineList.js +3 -0
- package/dist/types/raw/composite/TimelineList.js.map +1 -0
- package/dist/types/raw/dm/Conversation.d.ts +55 -0
- package/dist/types/raw/dm/Conversation.js +4 -0
- package/dist/types/raw/dm/Conversation.js.map +1 -0
- package/dist/types/raw/dm/InboxInitial.d.ts +137 -0
- package/dist/types/raw/dm/InboxInitial.js +4 -0
- package/dist/types/raw/dm/InboxInitial.js.map +1 -0
- package/dist/types/raw/dm/InboxTimeline.d.ts +287 -0
- package/dist/types/raw/dm/InboxTimeline.js +4 -0
- package/dist/types/raw/dm/InboxTimeline.js.map +1 -0
- package/dist/types/raw/dm/UserUpdates.d.ts +41 -0
- package/dist/types/raw/dm/UserUpdates.js +4 -0
- package/dist/types/raw/dm/UserUpdates.js.map +1 -0
- package/dist/types/raw/list/AddMember.d.ts +151 -0
- package/dist/types/raw/list/AddMember.js +4 -0
- package/dist/types/raw/list/AddMember.js.map +1 -0
- package/dist/types/raw/list/Details.d.ts +44 -13
- package/dist/types/raw/list/RemoveMember.d.ts +150 -0
- package/dist/types/raw/list/RemoveMember.js +4 -0
- package/dist/types/raw/list/RemoveMember.js.map +1 -0
- package/dist/types/raw/tweet/Bookmark.d.ts +12 -0
- package/dist/types/raw/tweet/Bookmark.js +4 -0
- package/dist/types/raw/tweet/Bookmark.js.map +1 -0
- package/dist/types/raw/tweet/Unbookmark.d.ts +11 -0
- package/dist/types/raw/tweet/Unbookmark.js +4 -0
- package/dist/types/raw/tweet/Unbookmark.js.map +1 -0
- package/dist/types/raw/user/Analytics.d.ts +6 -18
- package/dist/types/raw/user/Analytics.js +0 -1
- package/dist/types/raw/user/Analytics.js.map +1 -1
- package/dist/types/raw/user/Lists.d.ts +319 -0
- package/dist/types/raw/user/Lists.js +4 -0
- package/dist/types/raw/user/Lists.js.map +1 -0
- package/eslint.config.mjs +1 -1
- package/package.json +13 -6
- package/playground/.env.example +1 -0
- package/playground/README.md +53 -0
- package/playground/index.js +15 -0
- package/playground/package.json +15 -0
- package/src/Rettiwt.ts +5 -0
- package/src/cli.ts +2 -0
- package/src/collections/Extractors.ts +29 -0
- package/src/collections/Groups.ts +11 -0
- package/src/collections/Requests.ts +20 -0
- package/src/commands/DirectMessage.ts +62 -0
- package/src/commands/List.ts +44 -3
- package/src/commands/Tweet.ts +29 -1
- package/src/commands/User.ts +65 -1
- package/src/enums/Data.ts +2 -0
- package/src/enums/Resource.ts +13 -0
- package/src/enums/raw/Analytics.ts +5 -2
- package/src/index.ts +15 -0
- package/src/models/args/FetchArgs.ts +17 -0
- package/src/models/args/PostArgs.ts +2 -0
- package/src/models/data/Analytics.ts +97 -0
- package/src/models/data/Conversation.ts +344 -0
- package/src/models/data/CursoredData.ts +7 -2
- package/src/models/data/DirectMessage.ts +335 -0
- package/src/models/data/Inbox.ts +124 -0
- package/src/models/data/List.ts +60 -1
- package/src/models/data/Tweet.ts +10 -8
- package/src/models/data/User.ts +6 -0
- package/src/requests/DirectMessage.ts +233 -0
- package/src/requests/List.ts +58 -0
- package/src/requests/Tweet.ts +32 -0
- package/src/requests/User.ts +70 -7
- package/src/services/public/DirectMessageService.ts +159 -0
- package/src/services/public/FetcherService.ts +86 -4
- package/src/services/public/ListService.ts +127 -0
- package/src/services/public/TweetService.ts +82 -0
- package/src/services/public/UserService.ts +110 -2
- package/src/types/args/FetchArgs.ts +77 -12
- package/src/types/args/PostArgs.ts +31 -11
- package/src/types/data/Analytics.ts +58 -0
- package/src/types/data/Conversation.ts +44 -0
- package/src/types/data/CursoredData.ts +4 -1
- package/src/types/data/DirectMessage.ts +33 -0
- package/src/types/data/Inbox.ts +23 -0
- package/src/types/data/List.ts +7 -1
- package/src/types/data/Tweet.ts +6 -6
- package/src/types/data/User.ts +6 -0
- package/src/types/raw/base/Analytic.ts +7 -1
- package/src/types/raw/base/Message.ts +22 -0
- package/src/types/raw/base/Tweet.ts +6 -6
- package/src/types/raw/base/User.ts +2 -1
- package/src/types/raw/composite/TimelineList.ts +10 -0
- package/src/types/raw/dm/Conversation.ts +59 -0
- package/src/types/raw/dm/InboxInitial.ts +155 -0
- package/src/types/raw/dm/InboxTimeline.ts +301 -0
- package/src/types/raw/dm/UserUpdates.ts +46 -0
- package/src/types/raw/list/AddMember.ts +175 -0
- package/src/types/raw/list/Details.ts +52 -13
- package/src/types/raw/list/RemoveMember.ts +174 -0
- package/src/types/raw/tweet/Bookmark.ts +14 -0
- package/src/types/raw/tweet/Unbookmark.ts +14 -0
- package/src/types/raw/user/Analytics.ts +6 -22
- package/src/types/raw/user/Lists.ts +378 -0
- package/tsconfig.json +1 -1
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RawAnalyticsGranularity, RawAnalyticsMetric } from '../../enums/raw/Analytics';
|
|
1
2
|
import { TweetRepliesSortType } from '../../enums/Tweet';
|
|
2
3
|
/**
|
|
3
4
|
* Options specifying the data that is to be fetched.
|
|
@@ -5,21 +6,42 @@ import { TweetRepliesSortType } from '../../enums/Tweet';
|
|
|
5
6
|
* @public
|
|
6
7
|
*/
|
|
7
8
|
export interface IFetchArgs {
|
|
9
|
+
/**
|
|
10
|
+
* The id of the active conversation.
|
|
11
|
+
*
|
|
12
|
+
* @remarks
|
|
13
|
+
* - Required only for {@link ResourceType.DM_USER_UPDATES}.
|
|
14
|
+
*/
|
|
15
|
+
activeConversationId?: string;
|
|
16
|
+
/**
|
|
17
|
+
* The maximum id of the data to fetch.
|
|
18
|
+
*
|
|
19
|
+
* @remarks
|
|
20
|
+
* - May be used for {@link ResourceType.DM_INBOX_TIMELINE} and {@link ResourceType.DM_CONVERSATION}.
|
|
21
|
+
*/
|
|
22
|
+
maxId?: string;
|
|
23
|
+
/**
|
|
24
|
+
* The id of the conversation to fetch.
|
|
25
|
+
*
|
|
26
|
+
* @remarks
|
|
27
|
+
* - Required only for {@link ResourceType.DM_CONVERSATION} and {@link ResourceType.DM_DELETE_CONVERSATION}.
|
|
28
|
+
*/
|
|
29
|
+
conversationId?: string;
|
|
8
30
|
/**
|
|
9
31
|
* The number of data items to fetch.
|
|
10
32
|
*
|
|
11
33
|
* @remarks
|
|
12
34
|
* - Works only for cursored resources.
|
|
13
|
-
* - Does not work for {@link
|
|
35
|
+
* - Does not work for {@link ResourceType.TWEET_REPLIES}.
|
|
14
36
|
* - Must be \<= 20 for:
|
|
15
|
-
* - {@link
|
|
16
|
-
* - {@link
|
|
17
|
-
* - {@link
|
|
37
|
+
* - {@link ResourceType.USER_TIMELINE}
|
|
38
|
+
* - {@link ResourceType.USER_TIMELINE}
|
|
39
|
+
* - {@link ResourceType.USER_TIMELINE_AND_REPLIES}
|
|
18
40
|
* - Must be \<= 100 for all other cursored resources.
|
|
19
|
-
* - Due a bug on Twitter's end, count does not work for {@link
|
|
41
|
+
* - Due a bug on Twitter's end, count does not work for {@link ResourceType.USER_FOLLOWERS} and {@link ResourceType.USER_FOLLOWING}.
|
|
20
42
|
* - Has not effect for:
|
|
21
|
-
* - {@link
|
|
22
|
-
* - {@link
|
|
43
|
+
* - {@link ResourceType.USER_FEED_FOLLOWED}
|
|
44
|
+
* - {@link ResourceType.USER_FEED_RECOMMENDED}
|
|
23
45
|
*/
|
|
24
46
|
count?: number;
|
|
25
47
|
/**
|
|
@@ -34,31 +56,66 @@ export interface IFetchArgs {
|
|
|
34
56
|
* The filter for searching tweets.
|
|
35
57
|
*
|
|
36
58
|
* @remarks
|
|
37
|
-
* Required when searching for tweets using {@link
|
|
59
|
+
* Required when searching for tweets using {@link ResourceType.TWEET_SEARCH}.
|
|
38
60
|
*/
|
|
39
61
|
filter?: ITweetFilter;
|
|
40
62
|
/**
|
|
41
63
|
* The id of the target resource.
|
|
42
64
|
*
|
|
43
65
|
* @remarks
|
|
44
|
-
* - Required for all resources except {@link
|
|
45
|
-
* - For {@link
|
|
66
|
+
* - Required for all resources except {@link ResourceType.TWEET_SEARCH} and {@link ResourceType.USER_TIMELINE_RECOMMENDED}.
|
|
67
|
+
* - For {@link ResourceType.USER_DETAILS_BY_USERNAME}, can be alphanumeric, while for others, is strictly numeric.
|
|
46
68
|
*/
|
|
47
69
|
id?: string;
|
|
48
70
|
/**
|
|
49
71
|
* The IDs of the target resources.
|
|
50
72
|
*
|
|
51
73
|
* @remarks
|
|
52
|
-
* - Required only for {@link
|
|
74
|
+
* - Required only for {@link ResourceType.TWEET_DETAILS_BULK} and {@link ResourceType.USER_DETAILS_BY_IDS_BULK}.
|
|
53
75
|
*/
|
|
54
76
|
ids?: string[];
|
|
55
77
|
/**
|
|
56
78
|
* The sorting to use for tweet results.
|
|
57
79
|
*
|
|
58
80
|
* @remarks
|
|
59
|
-
* - Only works for {@link
|
|
81
|
+
* - Only works for {@link ResourceType.TWEET_REPLIES}.
|
|
60
82
|
*/
|
|
61
83
|
sortBy?: TweetRepliesSortType;
|
|
84
|
+
/**
|
|
85
|
+
* The date to start fetching data from.
|
|
86
|
+
*
|
|
87
|
+
* @remarks
|
|
88
|
+
* - Only works for {@link EResourceType.USER_ANALYTICS}.
|
|
89
|
+
*/
|
|
90
|
+
fromTime?: Date;
|
|
91
|
+
/**
|
|
92
|
+
* The date to end fetching data at.
|
|
93
|
+
*
|
|
94
|
+
* @remarks
|
|
95
|
+
* - Only works for {@link EResourceType.USER_ANALYTICS}.
|
|
96
|
+
*/
|
|
97
|
+
toTime?: Date;
|
|
98
|
+
/**
|
|
99
|
+
* The granularity of the data to fetch.
|
|
100
|
+
*
|
|
101
|
+
* @remarks
|
|
102
|
+
* - Only works for {@link EResourceType.USER_ANALYTICS}.
|
|
103
|
+
*/
|
|
104
|
+
granularity?: RawAnalyticsGranularity;
|
|
105
|
+
/**
|
|
106
|
+
* The metrics to fetch.
|
|
107
|
+
*
|
|
108
|
+
* @remarks
|
|
109
|
+
* - Only works for {@link EResourceType.USER_ANALYTICS}.
|
|
110
|
+
*/
|
|
111
|
+
metrics?: RawAnalyticsMetric[];
|
|
112
|
+
/**
|
|
113
|
+
* Show the verified follower count and relationship counts in the response.
|
|
114
|
+
*
|
|
115
|
+
* @remarks
|
|
116
|
+
* - Only works for {@link EResourceType.USER_ANALYTICS}.
|
|
117
|
+
*/
|
|
118
|
+
showVerifiedFollowers?: boolean;
|
|
62
119
|
}
|
|
63
120
|
/**
|
|
64
121
|
* The filter to be used for searching tweets.
|
|
@@ -9,20 +9,22 @@ export interface IPostArgs {
|
|
|
9
9
|
*
|
|
10
10
|
* @remarks
|
|
11
11
|
* Required only when posting using the following resources:
|
|
12
|
-
* - {@link
|
|
13
|
-
* - {@link
|
|
14
|
-
* - {@link
|
|
15
|
-
* - {@link
|
|
16
|
-
* - {@link
|
|
17
|
-
* - {@link
|
|
18
|
-
* - {@link
|
|
12
|
+
* - {@link ResourceType.TWEET_BOOKMARK}
|
|
13
|
+
* - {@link ResourceType.TWEET_LIKE}
|
|
14
|
+
* - {@link ResourceType.TWEET_RETWEET}
|
|
15
|
+
* - {@link ResourceType.TWEET_UNBOOKMARK}
|
|
16
|
+
* - {@link ResourceType.TWEET_UNLIKE}
|
|
17
|
+
* - {@link ResourceType.TWEET_UNPOST}
|
|
18
|
+
* - {@link ResourceType.TWEET_UNRETWEET}
|
|
19
|
+
* - {@link ResourceType.USER_FOLLOW}
|
|
20
|
+
* - {@link ResourceType.USER_UNFOLLOW}
|
|
19
21
|
*/
|
|
20
22
|
id?: string;
|
|
21
23
|
/**
|
|
22
24
|
* The tweet that is to be posted.
|
|
23
25
|
*
|
|
24
26
|
* @remarks
|
|
25
|
-
* Required only when posting a tweet using {@link
|
|
27
|
+
* Required only when posting a tweet using {@link ResourceType.TWEET_POST}
|
|
26
28
|
*/
|
|
27
29
|
tweet?: INewTweet;
|
|
28
30
|
/**
|
|
@@ -30,11 +32,27 @@ export interface IPostArgs {
|
|
|
30
32
|
*
|
|
31
33
|
* @remarks
|
|
32
34
|
* Required only when uploading a media using the following resources:
|
|
33
|
-
* - {@link
|
|
34
|
-
* - {@link
|
|
35
|
-
* - {@link
|
|
35
|
+
* - {@link ResourceType.MEDIA_UPLOAD_APPEND}
|
|
36
|
+
* - {@link ResourceType.MEDIA_UPLOAD_FINALIZE}
|
|
37
|
+
* - {@link ResourceType.MEDIA_UPLOAD_INITIALIZE}
|
|
36
38
|
*/
|
|
37
39
|
upload?: IUploadArgs;
|
|
40
|
+
/**
|
|
41
|
+
* The id of the target user.
|
|
42
|
+
*
|
|
43
|
+
* @remarks
|
|
44
|
+
* Required only for the following resources:
|
|
45
|
+
* - {@link ResourceType.LIST_MEMBER_ADD}
|
|
46
|
+
* - {@link ResourceType.LIST_MEMBER_REMOVE}
|
|
47
|
+
*/
|
|
48
|
+
userId?: string;
|
|
49
|
+
/**
|
|
50
|
+
* The id of the conversation to delete.
|
|
51
|
+
*
|
|
52
|
+
* @remarks
|
|
53
|
+
* Required only when deleting a conversation using {@link ResourceType.DM_DELETE_CONVERSATION}
|
|
54
|
+
*/
|
|
55
|
+
conversationId?: string;
|
|
38
56
|
}
|
|
39
57
|
/**
|
|
40
58
|
* Configuration for the new tweet to be posted.
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
import type { IAnalyticsMetric } from '../../types/raw/base/Analytic';
|
|
2
|
+
/**
|
|
3
|
+
* The details of the analytic result of the connected User.
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export interface IAnalytics {
|
|
8
|
+
/** The creation date of user's account. */
|
|
9
|
+
createdAt: string;
|
|
10
|
+
/** Total followers number */
|
|
11
|
+
followers: number;
|
|
12
|
+
/** Total verified followers */
|
|
13
|
+
verifiedFollowers: number;
|
|
14
|
+
/** Total impressions on the given period */
|
|
15
|
+
impressions: number;
|
|
16
|
+
/** Total profile visits on the given period */
|
|
17
|
+
profileVisits: number;
|
|
18
|
+
/** Total Engagements on the given period */
|
|
19
|
+
engagements: number;
|
|
20
|
+
/** Total Follows on the given period */
|
|
21
|
+
follows: number;
|
|
22
|
+
/** Total Replies on the given period */
|
|
23
|
+
replies: number;
|
|
24
|
+
/** Total Likes on the given period */
|
|
25
|
+
likes: number;
|
|
26
|
+
/** Total Retweets on the given period */
|
|
27
|
+
retweets: number;
|
|
28
|
+
/** Total Bookmark on the given period */
|
|
29
|
+
bookmarks: number;
|
|
30
|
+
/** Total Shares on the given period */
|
|
31
|
+
shares: number;
|
|
32
|
+
/** Total CreateTweets on the given period */
|
|
33
|
+
createTweets: number;
|
|
34
|
+
/** Total CreateQuote on the given period */
|
|
35
|
+
createQuote: number;
|
|
36
|
+
/** Total Unfollows on the given period */
|
|
37
|
+
unfollows: number;
|
|
38
|
+
/** Total CreateReply on the given period */
|
|
39
|
+
createReply: number;
|
|
40
|
+
/** Organic metrics times series */
|
|
41
|
+
organicMetricsTimeSeries: IAnalyticsMetric[];
|
|
42
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Analytics.js","sourceRoot":"","sources":["../../../src/types/data/Analytics.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
import { IDirectMessage } from './DirectMessage';
|
|
2
|
+
/**
|
|
3
|
+
* The details of a single conversation.
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export interface IConversation {
|
|
8
|
+
/** The unique identifier of the conversation. */
|
|
9
|
+
id: string;
|
|
10
|
+
/** The type of conversation (ONE_TO_ONE or GROUP_DM). */
|
|
11
|
+
type: 'ONE_TO_ONE' | 'GROUP_DM';
|
|
12
|
+
/** Array of participant user IDs. */
|
|
13
|
+
participants: string[];
|
|
14
|
+
/** The name of the conversation (for group DMs). */
|
|
15
|
+
name?: string;
|
|
16
|
+
/** URL to the conversation avatar (for group DMs). */
|
|
17
|
+
avatarUrl?: string;
|
|
18
|
+
/** Whether the conversation is trusted. */
|
|
19
|
+
trusted: boolean;
|
|
20
|
+
/** Whether the conversation is muted. */
|
|
21
|
+
muted: boolean;
|
|
22
|
+
/** Whether notifications are disabled. */
|
|
23
|
+
notificationsDisabled: boolean;
|
|
24
|
+
/** The timestamp of the last activity (ISO 8601 format). */
|
|
25
|
+
lastActivityAt: string;
|
|
26
|
+
/** The ID of the last message. */
|
|
27
|
+
lastMessageId?: string;
|
|
28
|
+
/** Whether there are more messages to load. */
|
|
29
|
+
hasMore: boolean;
|
|
30
|
+
/** Array of messages in this conversation. */
|
|
31
|
+
messages: IDirectMessage[];
|
|
32
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Conversation.js","sourceRoot":"","sources":["../../../src/types/data/Conversation.ts"],"names":[],"mappings":""}
|
|
@@ -1,3 +1,6 @@
|
|
|
1
|
+
import { IConversation } from './Conversation';
|
|
2
|
+
import { IDirectMessage } from './DirectMessage';
|
|
3
|
+
import { IList } from './List';
|
|
1
4
|
import { INotification } from './Notification';
|
|
2
5
|
import { ITweet } from './Tweet';
|
|
3
6
|
import { IUser } from './User';
|
|
@@ -8,7 +11,7 @@ import { IUser } from './User';
|
|
|
8
11
|
*
|
|
9
12
|
* @public
|
|
10
13
|
*/
|
|
11
|
-
export interface ICursoredData<T extends INotification | ITweet | IUser> {
|
|
14
|
+
export interface ICursoredData<T extends IDirectMessage | IConversation | INotification | ITweet | IUser | IList> {
|
|
12
15
|
/** The batch of data of the given type. */
|
|
13
16
|
list: T[];
|
|
14
17
|
/** The cursor to the next batch of data. */
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The details of a single direct message.
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export interface IDirectMessage {
|
|
7
|
+
/** The unique identifier of the message. */
|
|
8
|
+
id: string;
|
|
9
|
+
/** The ID of the conversation this message belongs to. */
|
|
10
|
+
conversationId: string;
|
|
11
|
+
/** The ID of the user who sent the message. */
|
|
12
|
+
senderId: string;
|
|
13
|
+
/** The ID of the user who received the message (for one-to-one conversations). */
|
|
14
|
+
recipientId?: string;
|
|
15
|
+
/** The text content of the message. */
|
|
16
|
+
text: string;
|
|
17
|
+
/** The timestamp when the message was sent (ISO 8601 format). */
|
|
18
|
+
createdAt: string;
|
|
19
|
+
/** Array of media URLs attached to the message. */
|
|
20
|
+
mediaUrls?: string[];
|
|
21
|
+
/** Number of times the message has been edited. */
|
|
22
|
+
editCount?: number;
|
|
23
|
+
/** Whether the message has been read. */
|
|
24
|
+
read?: boolean;
|
|
25
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"DirectMessage.js","sourceRoot":"","sources":["../../../src/types/data/DirectMessage.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { IConversation } from './Conversation';
|
|
2
|
+
/**
|
|
3
|
+
* The details of a DM inbox containing conversations and metadata.
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export interface IInbox {
|
|
8
|
+
/** List of conversations in the inbox. */
|
|
9
|
+
conversations: IConversation[];
|
|
10
|
+
/** The cursor for pagination of conversations. */
|
|
11
|
+
cursor: string;
|
|
12
|
+
/** The ID of the last seen event. */
|
|
13
|
+
lastSeenEventId: string;
|
|
14
|
+
/** The ID of the last seen trusted event. */
|
|
15
|
+
trustedLastSeenEventId: string;
|
|
16
|
+
/** The ID of the last seen untrusted event. */
|
|
17
|
+
untrustedLastSeenEventId: string;
|
|
18
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Inbox.js","sourceRoot":"","sources":["../../../src/types/data/Inbox.ts"],"names":[],"mappings":""}
|
|
@@ -6,12 +6,16 @@
|
|
|
6
6
|
export interface IList {
|
|
7
7
|
/** The date and time of creation of the list, int UTC string format. */
|
|
8
8
|
createdAt: string;
|
|
9
|
-
/** The
|
|
9
|
+
/** The ID of the user who created the list. */
|
|
10
10
|
createdBy: string;
|
|
11
11
|
/** The list description. */
|
|
12
12
|
description?: string;
|
|
13
|
+
/** Whether the user is following the list or not. */
|
|
14
|
+
isFollowing: boolean;
|
|
13
15
|
/** The rest id of the list. */
|
|
14
16
|
id: string;
|
|
17
|
+
/** Whether the user is a member of the list or not. */
|
|
18
|
+
isMember: boolean;
|
|
15
19
|
/** The number of memeber of the list. */
|
|
16
20
|
memberCount: number;
|
|
17
21
|
/** The name of the list. */
|
|
@@ -7,7 +7,7 @@ import { IUser } from './User';
|
|
|
7
7
|
*/
|
|
8
8
|
export interface ITweet {
|
|
9
9
|
/** The number of bookmarks of a tweet. */
|
|
10
|
-
bookmarkCount
|
|
10
|
+
bookmarkCount?: number;
|
|
11
11
|
/** The ID of tweet which started the current conversation. */
|
|
12
12
|
conversationId: string;
|
|
13
13
|
/** The creation date of the tweet. */
|
|
@@ -21,19 +21,19 @@ export interface ITweet {
|
|
|
21
21
|
/** The language in which the tweet is written. */
|
|
22
22
|
lang: string;
|
|
23
23
|
/** The number of likes of the tweet. */
|
|
24
|
-
likeCount
|
|
24
|
+
likeCount?: number;
|
|
25
25
|
/** The urls of the media contents of the tweet (if any). */
|
|
26
26
|
media?: ITweetMedia[];
|
|
27
27
|
/** The number of quotes of the tweet. */
|
|
28
|
-
quoteCount
|
|
28
|
+
quoteCount?: number;
|
|
29
29
|
/** The tweet which is quoted in the tweet. */
|
|
30
30
|
quoted?: ITweet;
|
|
31
31
|
/** The number of replies to the tweet. */
|
|
32
|
-
replyCount
|
|
32
|
+
replyCount?: number;
|
|
33
33
|
/** The rest id of the tweet to which the tweet is a reply. */
|
|
34
34
|
replyTo?: string;
|
|
35
35
|
/** The number of retweets of the tweet. */
|
|
36
|
-
retweetCount
|
|
36
|
+
retweetCount?: number;
|
|
37
37
|
/** The tweet which is retweeted in this tweet (if any). */
|
|
38
38
|
retweetedTweet?: ITweet;
|
|
39
39
|
/** The details of the user who made the tweet. */
|
|
@@ -41,7 +41,7 @@ export interface ITweet {
|
|
|
41
41
|
/** The URL to the tweet. */
|
|
42
42
|
url: string;
|
|
43
43
|
/** The number of views of a tweet. */
|
|
44
|
-
viewCount
|
|
44
|
+
viewCount?: number;
|
|
45
45
|
}
|
|
46
46
|
/**
|
|
47
47
|
* The different types parsed entities like urls, media, mentions, hashtags, etc.
|
|
@@ -16,6 +16,10 @@ export interface IUser {
|
|
|
16
16
|
fullName: string;
|
|
17
17
|
/** The rest id of the user. */
|
|
18
18
|
id: string;
|
|
19
|
+
/** Whether the user is being followed by the logged-in user. Available only when logged in. */
|
|
20
|
+
isFollowed?: boolean;
|
|
21
|
+
/** Whether the user is following the logged-in user. Available only when logged in. */
|
|
22
|
+
isFollowing?: boolean;
|
|
19
23
|
/** Whether the account is verified or not. */
|
|
20
24
|
isVerified: boolean;
|
|
21
25
|
/** The number of tweets liked by the user. */
|
|
@@ -6,10 +6,15 @@
|
|
|
6
6
|
export interface IAnalytics {
|
|
7
7
|
__typename: string;
|
|
8
8
|
organic_metrics_time_series: IAnalyticsMetric[];
|
|
9
|
+
verified_follower_count: string;
|
|
10
|
+
relationship_counts: IAnalyticsRelationships;
|
|
9
11
|
id: string;
|
|
10
12
|
}
|
|
13
|
+
export interface IAnalyticsRelationships {
|
|
14
|
+
followers: number;
|
|
15
|
+
}
|
|
11
16
|
export interface IAnalyticsMetric {
|
|
12
|
-
|
|
17
|
+
metric_values: IAnalyticsMetricValue[];
|
|
13
18
|
timestamp: IAnalyticsTimeStamp;
|
|
14
19
|
}
|
|
15
20
|
export interface IAnalyticsMetricValue {
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { ConversationMessage } from '../dm/Conversation';
|
|
2
|
+
import { Message } from '../dm/InboxInitial';
|
|
3
|
+
import { TimelineMessage } from '../dm/InboxTimeline';
|
|
4
|
+
type ConversationMessageData = ConversationMessage['message_data'];
|
|
5
|
+
type InboxMessageData = Message['message_data'];
|
|
6
|
+
type TimelineMessageData = TimelineMessage['message_data'];
|
|
7
|
+
type UnifiedMessageData = InboxMessageData & Partial<ConversationMessageData> & Partial<TimelineMessageData>;
|
|
8
|
+
export interface IMessage {
|
|
9
|
+
id: string;
|
|
10
|
+
time: string;
|
|
11
|
+
affects_sort?: boolean;
|
|
12
|
+
request_id: string;
|
|
13
|
+
conversation_id: string;
|
|
14
|
+
message_data: UnifiedMessageData;
|
|
15
|
+
}
|
|
16
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Message.js","sourceRoot":"","sources":["../../../../src/types/raw/base/Message.ts"],"names":[],"mappings":";AAAA,oBAAoB"}
|
|
@@ -14,7 +14,7 @@ export interface ITweet {
|
|
|
14
14
|
edit_control: ITweetEditControl;
|
|
15
15
|
edit_perspective: ITweetEditPerspective;
|
|
16
16
|
is_translatable: boolean;
|
|
17
|
-
views
|
|
17
|
+
views?: ITweetViews;
|
|
18
18
|
source: string;
|
|
19
19
|
quoted_status_result: IDataResult<ITweet | ILimitedVisibilityTweet>;
|
|
20
20
|
note_tweet: ITweetNote;
|
|
@@ -64,14 +64,14 @@ export interface ITweetNoteMedia {
|
|
|
64
64
|
inline_media: any[];
|
|
65
65
|
}
|
|
66
66
|
export interface ITweetLegacy {
|
|
67
|
-
bookmark_count
|
|
67
|
+
bookmark_count?: number;
|
|
68
68
|
bookmarked: boolean;
|
|
69
69
|
created_at: string;
|
|
70
70
|
conversation_id_str: string;
|
|
71
71
|
display_text_range: number[];
|
|
72
72
|
entities: IEntities;
|
|
73
73
|
extended_entities: IExtendedEntities;
|
|
74
|
-
favorite_count
|
|
74
|
+
favorite_count?: number;
|
|
75
75
|
favorited: boolean;
|
|
76
76
|
full_text: string;
|
|
77
77
|
in_reply_to_status_id_str: string;
|
|
@@ -79,10 +79,10 @@ export interface ITweetLegacy {
|
|
|
79
79
|
lang: string;
|
|
80
80
|
possibly_sensitive: boolean;
|
|
81
81
|
possibly_sensitive_editable: boolean;
|
|
82
|
-
quote_count
|
|
82
|
+
quote_count?: number;
|
|
83
83
|
quoted_status_id_str: string;
|
|
84
|
-
reply_count
|
|
85
|
-
retweet_count
|
|
84
|
+
reply_count?: number;
|
|
85
|
+
retweet_count?: number;
|
|
86
86
|
retweeted: boolean;
|
|
87
87
|
user_id_str: string;
|
|
88
88
|
id_str: string;
|
|
@@ -68,7 +68,8 @@ export interface IAffiliateHighlightedMentionResultLegacy {
|
|
|
68
68
|
screen_name: string;
|
|
69
69
|
}
|
|
70
70
|
export interface IUserLegacy {
|
|
71
|
-
|
|
71
|
+
followed_by?: boolean;
|
|
72
|
+
following?: boolean;
|
|
72
73
|
can_dm: boolean;
|
|
73
74
|
can_media_tag: boolean;
|
|
74
75
|
created_at: string;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"TimelineList.js","sourceRoot":"","sources":["../../../../src/types/raw/composite/TimelineList.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
import { Users, Conversations } from './InboxInitial';
|
|
2
|
+
/**
|
|
3
|
+
* The raw data received when fetching a specific conversation timeline.
|
|
4
|
+
*
|
|
5
|
+
* @public
|
|
6
|
+
*/
|
|
7
|
+
export interface IConversationTimelineResponse {
|
|
8
|
+
conversation_timeline: ConversationTimeline;
|
|
9
|
+
}
|
|
10
|
+
interface ConversationTimeline {
|
|
11
|
+
status: 'HAS_MORE' | 'AT_END';
|
|
12
|
+
min_entry_id: string;
|
|
13
|
+
max_entry_id: string;
|
|
14
|
+
entries: ConversationEntry[];
|
|
15
|
+
users: Users;
|
|
16
|
+
conversations: Conversations;
|
|
17
|
+
}
|
|
18
|
+
type ConversationEntry = {
|
|
19
|
+
message: ConversationMessage;
|
|
20
|
+
} | {
|
|
21
|
+
trust_conversation: TrustConversation;
|
|
22
|
+
};
|
|
23
|
+
export interface ConversationMessage {
|
|
24
|
+
id: string;
|
|
25
|
+
time: string;
|
|
26
|
+
request_id: string;
|
|
27
|
+
conversation_id: string;
|
|
28
|
+
message_data: ConversationMessageData;
|
|
29
|
+
}
|
|
30
|
+
interface ConversationMessageData {
|
|
31
|
+
id: string;
|
|
32
|
+
time: string;
|
|
33
|
+
recipient_id: string;
|
|
34
|
+
sender_id: string;
|
|
35
|
+
text: string;
|
|
36
|
+
edit_count?: number;
|
|
37
|
+
message_reactions?: MessageReaction[];
|
|
38
|
+
}
|
|
39
|
+
interface MessageReaction {
|
|
40
|
+
id: string;
|
|
41
|
+
time: string;
|
|
42
|
+
conversation_id: string;
|
|
43
|
+
message_id: string;
|
|
44
|
+
reaction_key: string;
|
|
45
|
+
emoji_reaction: string;
|
|
46
|
+
sender_id: string;
|
|
47
|
+
}
|
|
48
|
+
interface TrustConversation {
|
|
49
|
+
id: string;
|
|
50
|
+
time: string;
|
|
51
|
+
request_id: string;
|
|
52
|
+
conversation_id: string;
|
|
53
|
+
reason: string;
|
|
54
|
+
}
|
|
55
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Conversation.js","sourceRoot":"","sources":["../../../../src/types/raw/dm/Conversation.ts"],"names":[],"mappings":";AAAA,oBAAoB"}
|