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,6 +1,7 @@
|
|
|
1
1
|
import axios, { isAxiosError } from 'axios';
|
|
2
2
|
import { Cookie } from 'cookiejar';
|
|
3
|
-
import {
|
|
3
|
+
import { JSDOM } from 'jsdom';
|
|
4
|
+
import { ClientTransaction } from 'x-client-transaction-id-glacier';
|
|
4
5
|
|
|
5
6
|
import { AllowGuestAuthenticationGroup, FetchResourcesGroup, PostResourcesGroup } from '../../collections/Groups';
|
|
6
7
|
import { Requests } from '../../collections/Requests';
|
|
@@ -103,7 +104,7 @@ export class FetcherService {
|
|
|
103
104
|
*/
|
|
104
105
|
private async _getTransactionHeader(method: string, url: string): Promise<ITransactionHeader> {
|
|
105
106
|
// Get the X homepage HTML document (using utility function)
|
|
106
|
-
const document = await
|
|
107
|
+
const document = await this._handleXMigration();
|
|
107
108
|
|
|
108
109
|
// Create and initialize ClientTransaction instance
|
|
109
110
|
const transaction = await ClientTransaction.create(document);
|
|
@@ -121,6 +122,87 @@ export class FetcherService {
|
|
|
121
122
|
};
|
|
122
123
|
}
|
|
123
124
|
|
|
125
|
+
private async _handleXMigration(): Promise<Document> {
|
|
126
|
+
// Fetch X.com homepage
|
|
127
|
+
const homePageResponse = await axios.get<string>('https://x.com', {
|
|
128
|
+
headers: this.config.headers,
|
|
129
|
+
httpAgent: this.config.httpsAgent,
|
|
130
|
+
httpsAgent: this.config.httpsAgent,
|
|
131
|
+
});
|
|
132
|
+
|
|
133
|
+
// Parse HTML using linkedom
|
|
134
|
+
let dom = new JSDOM(homePageResponse.data);
|
|
135
|
+
let document = dom.window.document;
|
|
136
|
+
|
|
137
|
+
// Check for migration redirection links
|
|
138
|
+
const migrationRedirectionRegex = new RegExp(
|
|
139
|
+
'(http(?:s)?://(?:www\\.)?(twitter|x){1}\\.com(/x)?/migrate([/?])?tok=[a-zA-Z0-9%\\-_]+)+',
|
|
140
|
+
'i',
|
|
141
|
+
);
|
|
142
|
+
|
|
143
|
+
const metaRefresh = document.querySelector("meta[http-equiv='refresh']");
|
|
144
|
+
const metaContent = metaRefresh ? metaRefresh.getAttribute('content') || '' : '';
|
|
145
|
+
|
|
146
|
+
const migrationRedirectionUrl =
|
|
147
|
+
migrationRedirectionRegex.exec(metaContent) || migrationRedirectionRegex.exec(homePageResponse.data);
|
|
148
|
+
|
|
149
|
+
if (migrationRedirectionUrl) {
|
|
150
|
+
// Follow redirection URL
|
|
151
|
+
const redirectResponse = await axios.get<string>(migrationRedirectionUrl[0], {
|
|
152
|
+
httpAgent: this.config.httpsAgent,
|
|
153
|
+
httpsAgent: this.config.httpsAgent,
|
|
154
|
+
});
|
|
155
|
+
|
|
156
|
+
dom = new JSDOM(redirectResponse.data);
|
|
157
|
+
document = dom.window.document;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
// Handle migration form if present
|
|
161
|
+
const migrationForm =
|
|
162
|
+
document.querySelector("form[name='f']") ||
|
|
163
|
+
document.querySelector("form[action='https://x.com/x/migrate']");
|
|
164
|
+
|
|
165
|
+
if (migrationForm) {
|
|
166
|
+
const url = migrationForm.getAttribute('action') || 'https://x.com/x/migrate';
|
|
167
|
+
const method = migrationForm.getAttribute('method') || 'POST';
|
|
168
|
+
|
|
169
|
+
// Collect form input fields
|
|
170
|
+
const requestPayload = new FormData();
|
|
171
|
+
|
|
172
|
+
const inputFields = migrationForm.querySelectorAll('input');
|
|
173
|
+
for (const element of Array.from(inputFields)) {
|
|
174
|
+
const name = element.getAttribute('name');
|
|
175
|
+
const value = element.getAttribute('value');
|
|
176
|
+
if (name && value) {
|
|
177
|
+
requestPayload.append(name, value);
|
|
178
|
+
}
|
|
179
|
+
}
|
|
180
|
+
|
|
181
|
+
// Submit form using POST request
|
|
182
|
+
const formResponse = await axios.request<string>({
|
|
183
|
+
method: method,
|
|
184
|
+
url: url,
|
|
185
|
+
data: requestPayload,
|
|
186
|
+
headers: {
|
|
187
|
+
/* eslint-disable @typescript-eslint/naming-convention */
|
|
188
|
+
|
|
189
|
+
'Content-Type': 'multipart/form-data',
|
|
190
|
+
...this.config.headers,
|
|
191
|
+
|
|
192
|
+
/* eslint-enable @typescript-eslint/naming-convention */
|
|
193
|
+
},
|
|
194
|
+
httpAgent: this.config.httpsAgent,
|
|
195
|
+
httpsAgent: this.config.httpsAgent,
|
|
196
|
+
});
|
|
197
|
+
|
|
198
|
+
dom = new JSDOM(formResponse.data);
|
|
199
|
+
document = dom.window.document;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
// Return final DOM document
|
|
203
|
+
return document;
|
|
204
|
+
}
|
|
205
|
+
|
|
124
206
|
/**
|
|
125
207
|
* Validates the given args against the given resource.
|
|
126
208
|
*
|
|
@@ -180,13 +262,13 @@ export class FetcherService {
|
|
|
180
262
|
*
|
|
181
263
|
* #### Fetching the raw details of a single user, using their username
|
|
182
264
|
* ```ts
|
|
183
|
-
* import { FetcherService,
|
|
265
|
+
* import { FetcherService, ResourceType } from 'rettiwt-api';
|
|
184
266
|
*
|
|
185
267
|
* // Creating a new FetcherService instance using the given 'API_KEY'
|
|
186
268
|
* const fetcher = new FetcherService({ apiKey: API_KEY });
|
|
187
269
|
*
|
|
188
270
|
* // Fetching the details of the User with username 'user1'
|
|
189
|
-
* fetcher.request(
|
|
271
|
+
* fetcher.request(ResourceType.USER_DETAILS_BY_USERNAME, { id: 'user1' })
|
|
190
272
|
* .then(res => {
|
|
191
273
|
* console.log(res);
|
|
192
274
|
* })
|
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import { Extractors } from '../../collections/Extractors';
|
|
2
2
|
import { ResourceType } from '../../enums/Resource';
|
|
3
3
|
import { CursoredData } from '../../models/data/CursoredData';
|
|
4
|
+
import { List } from '../../models/data/List';
|
|
4
5
|
import { Tweet } from '../../models/data/Tweet';
|
|
5
6
|
import { User } from '../../models/data/User';
|
|
6
7
|
import { RettiwtConfig } from '../../models/RettiwtConfig';
|
|
8
|
+
import { IListMemberAddResponse } from '../../types/raw/list/AddMember';
|
|
9
|
+
import { IListDetailsResponse } from '../../types/raw/list/Details';
|
|
7
10
|
import { IListMembersResponse } from '../../types/raw/list/Members';
|
|
11
|
+
import { IListMemberRemoveResponse } from '../../types/raw/list/RemoveMember';
|
|
8
12
|
import { IListTweetsResponse } from '../../types/raw/list/Tweets';
|
|
9
13
|
|
|
10
14
|
import { FetcherService } from './FetcherService';
|
|
@@ -19,6 +23,88 @@ export class ListService extends FetcherService {
|
|
|
19
23
|
super(config);
|
|
20
24
|
}
|
|
21
25
|
|
|
26
|
+
/**
|
|
27
|
+
* Add a user as a member of a list.
|
|
28
|
+
*
|
|
29
|
+
* @param listId - The ID of the target list.
|
|
30
|
+
* @param userId - The ID of the target user to be added as a member.
|
|
31
|
+
*
|
|
32
|
+
* @returns The new member count of the list. If adding was unsuccessful, return `undefined`.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
*
|
|
36
|
+
* ```ts
|
|
37
|
+
* import { Rettiwt } from 'rettiwt-api';
|
|
38
|
+
*
|
|
39
|
+
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
40
|
+
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
41
|
+
*
|
|
42
|
+
* // Adding a user with ID '123456789' as a member to the list with ID '987654321'
|
|
43
|
+
* rettiwt.list.addMember('987654321', '123456789')
|
|
44
|
+
* .then(res => {
|
|
45
|
+
* console.log(res);
|
|
46
|
+
* })
|
|
47
|
+
* .catch(err => {
|
|
48
|
+
* console.log(err);
|
|
49
|
+
* });
|
|
50
|
+
* ```
|
|
51
|
+
*/
|
|
52
|
+
public async addMember(listId: string, userId: string): Promise<number | undefined> {
|
|
53
|
+
const resource: ResourceType = ResourceType.LIST_MEMBER_ADD;
|
|
54
|
+
|
|
55
|
+
// Adding the user as a member
|
|
56
|
+
const response = await this.request<IListMemberAddResponse>(resource, {
|
|
57
|
+
id: listId,
|
|
58
|
+
userId: userId,
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
// Deserializing response
|
|
62
|
+
const data = Extractors[resource](response);
|
|
63
|
+
|
|
64
|
+
return data;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Get the details of a list.
|
|
69
|
+
*
|
|
70
|
+
* @param id - The ID of the target list.
|
|
71
|
+
*
|
|
72
|
+
* @returns
|
|
73
|
+
* The details of the target list.
|
|
74
|
+
*
|
|
75
|
+
* If list not found, returns undefined.
|
|
76
|
+
*
|
|
77
|
+
* @example
|
|
78
|
+
*
|
|
79
|
+
* #### Fetching the details of a list
|
|
80
|
+
* ```ts
|
|
81
|
+
* import { Rettiwt } from 'rettiwt-api';
|
|
82
|
+
*
|
|
83
|
+
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
84
|
+
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
85
|
+
*
|
|
86
|
+
* // Fetching the details of the list with the id '1234567890'
|
|
87
|
+
* rettiwt.list.details('1234567890')
|
|
88
|
+
* .then(res => {
|
|
89
|
+
* console.log(res);
|
|
90
|
+
* })
|
|
91
|
+
* .catch(err => {
|
|
92
|
+
* console.log(err);
|
|
93
|
+
* });
|
|
94
|
+
* ```
|
|
95
|
+
*/
|
|
96
|
+
public async details(id: string): Promise<List | undefined> {
|
|
97
|
+
const resource: ResourceType = ResourceType.LIST_DETAILS;
|
|
98
|
+
|
|
99
|
+
// Getting the details of the list
|
|
100
|
+
const response = await this.request<IListDetailsResponse>(resource, { id: id });
|
|
101
|
+
|
|
102
|
+
// Deserializing response
|
|
103
|
+
const data = Extractors[resource](response, id);
|
|
104
|
+
|
|
105
|
+
return data;
|
|
106
|
+
}
|
|
107
|
+
|
|
22
108
|
/**
|
|
23
109
|
* Get the list of members of a tweet list.
|
|
24
110
|
*
|
|
@@ -64,6 +150,47 @@ export class ListService extends FetcherService {
|
|
|
64
150
|
return data;
|
|
65
151
|
}
|
|
66
152
|
|
|
153
|
+
/**
|
|
154
|
+
* Remove a member from a list.
|
|
155
|
+
*
|
|
156
|
+
* @param listId - The ID of the target list.
|
|
157
|
+
* @param userId - The ID of the target user to removed from the members.
|
|
158
|
+
*
|
|
159
|
+
* @returns The new member count of the list. If removal was unsuccessful, return `undefined`.
|
|
160
|
+
*
|
|
161
|
+
* @example
|
|
162
|
+
*
|
|
163
|
+
* ```ts
|
|
164
|
+
* import { Rettiwt } from 'rettiwt-api';
|
|
165
|
+
*
|
|
166
|
+
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
167
|
+
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
168
|
+
*
|
|
169
|
+
* // Removing a user with ID '123456789' from the member of the list with ID '987654321'
|
|
170
|
+
* rettiwt.list.removeMember('987654321', '123456789')
|
|
171
|
+
* .then(res => {
|
|
172
|
+
* console.log(res);
|
|
173
|
+
* })
|
|
174
|
+
* .catch(err => {
|
|
175
|
+
* console.log(err);
|
|
176
|
+
* });
|
|
177
|
+
* ```
|
|
178
|
+
*/
|
|
179
|
+
public async removeMember(listId: string, userId: string): Promise<number | undefined> {
|
|
180
|
+
const resource: ResourceType = ResourceType.LIST_MEMBER_REMOVE;
|
|
181
|
+
|
|
182
|
+
// Removing the member
|
|
183
|
+
const response = await this.request<IListMemberRemoveResponse>(resource, {
|
|
184
|
+
id: listId,
|
|
185
|
+
userId: userId,
|
|
186
|
+
});
|
|
187
|
+
|
|
188
|
+
// Deserializing response
|
|
189
|
+
const data = Extractors[resource](response);
|
|
190
|
+
|
|
191
|
+
return data;
|
|
192
|
+
}
|
|
193
|
+
|
|
67
194
|
/**
|
|
68
195
|
* Get the list of tweets from a tweet list.
|
|
69
196
|
*
|
|
@@ -12,6 +12,7 @@ import { ITweetFilter } from '../../types/args/FetchArgs';
|
|
|
12
12
|
import { INewTweet } from '../../types/args/PostArgs';
|
|
13
13
|
import { IMediaInitializeUploadResponse } from '../../types/raw/media/InitalizeUpload';
|
|
14
14
|
|
|
15
|
+
import { ITweetBookmarkResponse } from '../../types/raw/tweet/Bookmark';
|
|
15
16
|
import { ITweetDetailsResponse } from '../../types/raw/tweet/Details';
|
|
16
17
|
import { ITweetDetailsBulkResponse } from '../../types/raw/tweet/DetailsBulk';
|
|
17
18
|
import { ITweetLikeResponse } from '../../types/raw/tweet/Like';
|
|
@@ -22,6 +23,7 @@ import { ITweetRetweetResponse } from '../../types/raw/tweet/Retweet';
|
|
|
22
23
|
import { ITweetRetweetersResponse } from '../../types/raw/tweet/Retweeters';
|
|
23
24
|
import { ITweetScheduleResponse } from '../../types/raw/tweet/Schedule';
|
|
24
25
|
import { ITweetSearchResponse } from '../../types/raw/tweet/Search';
|
|
26
|
+
import { ITweetUnbookmarkResponse } from '../../types/raw/tweet/Unbookmark';
|
|
25
27
|
import { ITweetUnlikeResponse } from '../../types/raw/tweet/Unlike';
|
|
26
28
|
import { ITweetUnpostResponse } from '../../types/raw/tweet/Unpost';
|
|
27
29
|
import { ITweetUnretweetResponse } from '../../types/raw/tweet/Unretweet';
|
|
@@ -44,6 +46,45 @@ export class TweetService extends FetcherService {
|
|
|
44
46
|
super(config);
|
|
45
47
|
}
|
|
46
48
|
|
|
49
|
+
/**
|
|
50
|
+
* Bookmark a tweet.
|
|
51
|
+
*
|
|
52
|
+
* @param id - The ID of the tweet to be bookmarked.
|
|
53
|
+
*
|
|
54
|
+
* @returns Whether bookmarking was successful or not.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
*
|
|
58
|
+
* ```ts
|
|
59
|
+
* import { Rettiwt } from 'rettiwt-api';
|
|
60
|
+
*
|
|
61
|
+
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
62
|
+
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
63
|
+
*
|
|
64
|
+
* // Bookmarking the Tweet with id '1234567890'
|
|
65
|
+
* rettiwt.tweet.bookmark('1234567890')
|
|
66
|
+
* .then(res => {
|
|
67
|
+
* console.log(res);
|
|
68
|
+
* })
|
|
69
|
+
* .catch(err => {
|
|
70
|
+
* console.log(err);
|
|
71
|
+
* });
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
public async bookmark(id: string): Promise<boolean> {
|
|
75
|
+
const resource = ResourceType.TWEET_BOOKMARK;
|
|
76
|
+
|
|
77
|
+
// Favoriting the tweet
|
|
78
|
+
const response = await this.request<ITweetBookmarkResponse>(resource, {
|
|
79
|
+
id: id,
|
|
80
|
+
});
|
|
81
|
+
|
|
82
|
+
// Deserializing response
|
|
83
|
+
const data = Extractors[resource](response) ?? false;
|
|
84
|
+
|
|
85
|
+
return data;
|
|
86
|
+
}
|
|
87
|
+
|
|
47
88
|
/**
|
|
48
89
|
* Get the details of one or more tweets.
|
|
49
90
|
*
|
|
@@ -315,6 +356,10 @@ export class TweetService extends FetcherService {
|
|
|
315
356
|
/**
|
|
316
357
|
* Get the list of replies to a tweet.
|
|
317
358
|
*
|
|
359
|
+
* If the target tweet is a thread,
|
|
360
|
+
* the first batch always contains all the tweets in the thread,
|
|
361
|
+
* if `sortBy` is set to {@link TweetRepliesSortType.RELEVANCE}.
|
|
362
|
+
*
|
|
318
363
|
* @param id - The ID of the target tweet.
|
|
319
364
|
* @param cursor - The cursor to the batch of replies to fetch.
|
|
320
365
|
* @param sortBy - The sorting order of the replies to fetch. Default is {@link TweetRepliesSortType.RECENT}.
|
|
@@ -605,6 +650,43 @@ export class TweetService extends FetcherService {
|
|
|
605
650
|
}
|
|
606
651
|
}
|
|
607
652
|
|
|
653
|
+
/**
|
|
654
|
+
* Unbookmark a tweet.
|
|
655
|
+
*
|
|
656
|
+
* @param id - The ID of the target tweet.
|
|
657
|
+
*
|
|
658
|
+
* @returns Whether unbookmarking was successful or not.
|
|
659
|
+
*
|
|
660
|
+
* @example
|
|
661
|
+
*
|
|
662
|
+
* ```ts
|
|
663
|
+
* import { Rettiwt } from 'rettiwt-api';
|
|
664
|
+
*
|
|
665
|
+
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
666
|
+
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
667
|
+
*
|
|
668
|
+
* // Unbookmarking the tweet with id '1234567890'
|
|
669
|
+
* rettiwt.tweet.unbookmark('1234567890')
|
|
670
|
+
* .then(res => {
|
|
671
|
+
* console.log(res);
|
|
672
|
+
* })
|
|
673
|
+
* .catch(err => {
|
|
674
|
+
* console.log(err);
|
|
675
|
+
* });
|
|
676
|
+
* ```
|
|
677
|
+
*/
|
|
678
|
+
public async unbookmark(id: string): Promise<boolean> {
|
|
679
|
+
const resource = ResourceType.TWEET_UNBOOKMARK;
|
|
680
|
+
|
|
681
|
+
// Unliking the tweet
|
|
682
|
+
const response = await this.request<ITweetUnbookmarkResponse>(resource, { id: id });
|
|
683
|
+
|
|
684
|
+
// Deserializing the response
|
|
685
|
+
const data = Extractors[resource](response) ?? false;
|
|
686
|
+
|
|
687
|
+
return data;
|
|
688
|
+
}
|
|
689
|
+
|
|
608
690
|
/**
|
|
609
691
|
* Unlike a tweet.
|
|
610
692
|
*
|
|
@@ -1,11 +1,15 @@
|
|
|
1
1
|
import { Extractors } from '../../collections/Extractors';
|
|
2
|
+
import { RawAnalyticsGranularity, RawAnalyticsMetric } from '../../enums/raw/Analytics';
|
|
2
3
|
import { ResourceType } from '../../enums/Resource';
|
|
4
|
+
import { Analytics } from '../../models/data/Analytics';
|
|
3
5
|
import { CursoredData } from '../../models/data/CursoredData';
|
|
6
|
+
import { List } from '../../models/data/List';
|
|
4
7
|
import { Notification } from '../../models/data/Notification';
|
|
5
8
|
import { Tweet } from '../../models/data/Tweet';
|
|
6
9
|
import { User } from '../../models/data/User';
|
|
7
10
|
import { RettiwtConfig } from '../../models/RettiwtConfig';
|
|
8
11
|
import { IUserAffiliatesResponse } from '../../types/raw/user/Affiliates';
|
|
12
|
+
import { IUserAnalyticsResponse } from '../../types/raw/user/Analytics';
|
|
9
13
|
import { IUserBookmarksResponse } from '../../types/raw/user/Bookmarks';
|
|
10
14
|
import { IUserDetailsResponse } from '../../types/raw/user/Details';
|
|
11
15
|
import { IUserDetailsBulkResponse } from '../../types/raw/user/DetailsBulk';
|
|
@@ -15,6 +19,7 @@ import { IUserFollowersResponse } from '../../types/raw/user/Followers';
|
|
|
15
19
|
import { IUserFollowingResponse } from '../../types/raw/user/Following';
|
|
16
20
|
import { IUserHighlightsResponse } from '../../types/raw/user/Highlights';
|
|
17
21
|
import { IUserLikesResponse } from '../../types/raw/user/Likes';
|
|
22
|
+
import { IUserListsResponse } from '../../types/raw/user/Lists';
|
|
18
23
|
import { IUserMediaResponse } from '../../types/raw/user/Media';
|
|
19
24
|
import { IUserNotificationsResponse } from '../../types/raw/user/Notifications';
|
|
20
25
|
import { IUserRecommendedResponse } from '../../types/raw/user/Recommended';
|
|
@@ -83,6 +88,64 @@ export class UserService extends FetcherService {
|
|
|
83
88
|
return data;
|
|
84
89
|
}
|
|
85
90
|
|
|
91
|
+
/**
|
|
92
|
+
* Get the analytics overview of the logged in user.
|
|
93
|
+
*
|
|
94
|
+
* @param fromTime - The start time of the analytics period. Defaults to 7 days ago.
|
|
95
|
+
* @param toTime - The end time of the analytics period. Defaults to now.
|
|
96
|
+
* @param granularity - The granularity of the analytics data. Defaults to daily.
|
|
97
|
+
* @param metrics - The metrics to include in the analytics data. Defaults to all available metrics available.
|
|
98
|
+
* @param showVerifiedFollowers - Whether to include verified follower count and relationship counts in the response. Defaults to true.
|
|
99
|
+
*
|
|
100
|
+
* @returns The raw analytics data of the user.
|
|
101
|
+
*
|
|
102
|
+
* @example
|
|
103
|
+
*
|
|
104
|
+
* ```ts
|
|
105
|
+
* import { Rettiwt } from 'rettiwt-api';
|
|
106
|
+
*
|
|
107
|
+
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
108
|
+
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
109
|
+
*
|
|
110
|
+
* // Fetching the analytics overview of the logged in user
|
|
111
|
+
* rettiwt.user.analytics().then(res => {
|
|
112
|
+
* console.log(res);
|
|
113
|
+
* })
|
|
114
|
+
* .catch(err => {
|
|
115
|
+
* console.log(err);
|
|
116
|
+
* });
|
|
117
|
+
* ```
|
|
118
|
+
*/
|
|
119
|
+
public async analytics(
|
|
120
|
+
fromTime?: Date,
|
|
121
|
+
toTime?: Date,
|
|
122
|
+
granularity?: RawAnalyticsGranularity,
|
|
123
|
+
metrics?: RawAnalyticsMetric[],
|
|
124
|
+
showVerifiedFollowers?: boolean,
|
|
125
|
+
): Promise<Analytics> {
|
|
126
|
+
const resource = ResourceType.USER_ANALYTICS;
|
|
127
|
+
|
|
128
|
+
// Define default values if not provided
|
|
129
|
+
fromTime = fromTime ?? new Date(Date.now() - 7 * 24 * 60 * 60 * 1000);
|
|
130
|
+
toTime = toTime ?? new Date();
|
|
131
|
+
granularity = granularity ?? RawAnalyticsGranularity.DAILY;
|
|
132
|
+
metrics = metrics ?? Object.values(RawAnalyticsMetric);
|
|
133
|
+
showVerifiedFollowers = showVerifiedFollowers ?? true;
|
|
134
|
+
|
|
135
|
+
// Fetching raw analytics
|
|
136
|
+
const response = await this.request<IUserAnalyticsResponse>(resource, {
|
|
137
|
+
fromTime,
|
|
138
|
+
toTime,
|
|
139
|
+
granularity,
|
|
140
|
+
metrics,
|
|
141
|
+
showVerifiedFollowers,
|
|
142
|
+
});
|
|
143
|
+
|
|
144
|
+
const data = Extractors[resource](response);
|
|
145
|
+
|
|
146
|
+
return data;
|
|
147
|
+
}
|
|
148
|
+
|
|
86
149
|
/**
|
|
87
150
|
* Get the list of bookmarks of the logged in user.
|
|
88
151
|
*
|
|
@@ -165,8 +228,8 @@ export class UserService extends FetcherService {
|
|
|
165
228
|
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
166
229
|
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
167
230
|
*
|
|
168
|
-
* // Fetching the details of the User with username 'user1'
|
|
169
|
-
* rettiwt.user.details('user1')
|
|
231
|
+
* // Fetching the details of the User with username 'user1' or '@user1'
|
|
232
|
+
* rettiwt.user.details('user1') // or @user1
|
|
170
233
|
* .then(res => {
|
|
171
234
|
* console.log(res);
|
|
172
235
|
* })
|
|
@@ -243,6 +306,9 @@ export class UserService extends FetcherService {
|
|
|
243
306
|
// If username is given
|
|
244
307
|
if (id && isNaN(Number(id))) {
|
|
245
308
|
resource = ResourceType.USER_DETAILS_BY_USERNAME;
|
|
309
|
+
if (id?.startsWith('@')) {
|
|
310
|
+
id = id.slice(1);
|
|
311
|
+
}
|
|
246
312
|
}
|
|
247
313
|
// If id is given (or not, for self details)
|
|
248
314
|
else {
|
|
@@ -515,6 +581,48 @@ export class UserService extends FetcherService {
|
|
|
515
581
|
return data;
|
|
516
582
|
}
|
|
517
583
|
|
|
584
|
+
/**
|
|
585
|
+
* Get the list of of the the logged in user. Includes both followed and owned.
|
|
586
|
+
*
|
|
587
|
+
* @param count - The number of lists to fetch, must be \<= 100.
|
|
588
|
+
* @param cursor - The cursor to the batch of likes to fetch.
|
|
589
|
+
*
|
|
590
|
+
* @returns The list of tweets liked by the target user.
|
|
591
|
+
*
|
|
592
|
+
* @example
|
|
593
|
+
*
|
|
594
|
+
* ```ts
|
|
595
|
+
* import { Rettiwt } from 'rettiwt-api';
|
|
596
|
+
*
|
|
597
|
+
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
598
|
+
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
599
|
+
*
|
|
600
|
+
* // Fetching the first 100 Lists of the logged in User
|
|
601
|
+
* rettiwt.user.lists()
|
|
602
|
+
* .then(res => {
|
|
603
|
+
* console.log(res);
|
|
604
|
+
* })
|
|
605
|
+
* .catch(err => {
|
|
606
|
+
* console.log(err);
|
|
607
|
+
* });
|
|
608
|
+
* ```
|
|
609
|
+
*/
|
|
610
|
+
public async lists(count?: number, cursor?: string): Promise<CursoredData<List>> {
|
|
611
|
+
const resource = ResourceType.USER_LISTS;
|
|
612
|
+
|
|
613
|
+
// Fetching raw list of lists
|
|
614
|
+
const response = await this.request<IUserListsResponse>(resource, {
|
|
615
|
+
id: this.config.userId,
|
|
616
|
+
count: count,
|
|
617
|
+
cursor: cursor,
|
|
618
|
+
});
|
|
619
|
+
|
|
620
|
+
// Deserializing response
|
|
621
|
+
const data = Extractors[resource](response);
|
|
622
|
+
|
|
623
|
+
return data;
|
|
624
|
+
}
|
|
625
|
+
|
|
518
626
|
/**
|
|
519
627
|
* Get the media timeline of a user.
|
|
520
628
|
*
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { RawAnalyticsGranularity, RawAnalyticsMetric } from '../../enums/raw/Analytics';
|
|
1
2
|
import { TweetRepliesSortType } from '../../enums/Tweet';
|
|
2
3
|
|
|
3
4
|
/**
|
|
@@ -6,21 +7,45 @@ import { TweetRepliesSortType } from '../../enums/Tweet';
|
|
|
6
7
|
* @public
|
|
7
8
|
*/
|
|
8
9
|
export interface IFetchArgs {
|
|
10
|
+
/**
|
|
11
|
+
* The id of the active conversation.
|
|
12
|
+
*
|
|
13
|
+
* @remarks
|
|
14
|
+
* - Required only for {@link ResourceType.DM_USER_UPDATES}.
|
|
15
|
+
*/
|
|
16
|
+
activeConversationId?: string;
|
|
17
|
+
|
|
18
|
+
/**
|
|
19
|
+
* The maximum id of the data to fetch.
|
|
20
|
+
*
|
|
21
|
+
* @remarks
|
|
22
|
+
* - May be used for {@link ResourceType.DM_INBOX_TIMELINE} and {@link ResourceType.DM_CONVERSATION}.
|
|
23
|
+
*/
|
|
24
|
+
maxId?: string;
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* The id of the conversation to fetch.
|
|
28
|
+
*
|
|
29
|
+
* @remarks
|
|
30
|
+
* - Required only for {@link ResourceType.DM_CONVERSATION} and {@link ResourceType.DM_DELETE_CONVERSATION}.
|
|
31
|
+
*/
|
|
32
|
+
conversationId?: string;
|
|
33
|
+
|
|
9
34
|
/**
|
|
10
35
|
* The number of data items to fetch.
|
|
11
36
|
*
|
|
12
37
|
* @remarks
|
|
13
38
|
* - Works only for cursored resources.
|
|
14
|
-
* - Does not work for {@link
|
|
39
|
+
* - Does not work for {@link ResourceType.TWEET_REPLIES}.
|
|
15
40
|
* - Must be \<= 20 for:
|
|
16
|
-
* - {@link
|
|
17
|
-
* - {@link
|
|
18
|
-
* - {@link
|
|
41
|
+
* - {@link ResourceType.USER_TIMELINE}
|
|
42
|
+
* - {@link ResourceType.USER_TIMELINE}
|
|
43
|
+
* - {@link ResourceType.USER_TIMELINE_AND_REPLIES}
|
|
19
44
|
* - Must be \<= 100 for all other cursored resources.
|
|
20
|
-
* - Due a bug on Twitter's end, count does not work for {@link
|
|
45
|
+
* - Due a bug on Twitter's end, count does not work for {@link ResourceType.USER_FOLLOWERS} and {@link ResourceType.USER_FOLLOWING}.
|
|
21
46
|
* - Has not effect for:
|
|
22
|
-
* - {@link
|
|
23
|
-
* - {@link
|
|
47
|
+
* - {@link ResourceType.USER_FEED_FOLLOWED}
|
|
48
|
+
* - {@link ResourceType.USER_FEED_RECOMMENDED}
|
|
24
49
|
*/
|
|
25
50
|
count?: number;
|
|
26
51
|
|
|
@@ -37,7 +62,7 @@ export interface IFetchArgs {
|
|
|
37
62
|
* The filter for searching tweets.
|
|
38
63
|
*
|
|
39
64
|
* @remarks
|
|
40
|
-
* Required when searching for tweets using {@link
|
|
65
|
+
* Required when searching for tweets using {@link ResourceType.TWEET_SEARCH}.
|
|
41
66
|
*/
|
|
42
67
|
filter?: ITweetFilter;
|
|
43
68
|
|
|
@@ -45,8 +70,8 @@ export interface IFetchArgs {
|
|
|
45
70
|
* The id of the target resource.
|
|
46
71
|
*
|
|
47
72
|
* @remarks
|
|
48
|
-
* - Required for all resources except {@link
|
|
49
|
-
* - For {@link
|
|
73
|
+
* - Required for all resources except {@link ResourceType.TWEET_SEARCH} and {@link ResourceType.USER_TIMELINE_RECOMMENDED}.
|
|
74
|
+
* - For {@link ResourceType.USER_DETAILS_BY_USERNAME}, can be alphanumeric, while for others, is strictly numeric.
|
|
50
75
|
*/
|
|
51
76
|
id?: string;
|
|
52
77
|
|
|
@@ -54,7 +79,7 @@ export interface IFetchArgs {
|
|
|
54
79
|
* The IDs of the target resources.
|
|
55
80
|
*
|
|
56
81
|
* @remarks
|
|
57
|
-
* - Required only for {@link
|
|
82
|
+
* - Required only for {@link ResourceType.TWEET_DETAILS_BULK} and {@link ResourceType.USER_DETAILS_BY_IDS_BULK}.
|
|
58
83
|
*/
|
|
59
84
|
ids?: string[];
|
|
60
85
|
|
|
@@ -62,9 +87,49 @@ export interface IFetchArgs {
|
|
|
62
87
|
* The sorting to use for tweet results.
|
|
63
88
|
*
|
|
64
89
|
* @remarks
|
|
65
|
-
* - Only works for {@link
|
|
90
|
+
* - Only works for {@link ResourceType.TWEET_REPLIES}.
|
|
66
91
|
*/
|
|
67
92
|
sortBy?: TweetRepliesSortType;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* The date to start fetching data from.
|
|
96
|
+
*
|
|
97
|
+
* @remarks
|
|
98
|
+
* - Only works for {@link EResourceType.USER_ANALYTICS}.
|
|
99
|
+
*/
|
|
100
|
+
fromTime?: Date;
|
|
101
|
+
|
|
102
|
+
/**
|
|
103
|
+
* The date to end fetching data at.
|
|
104
|
+
*
|
|
105
|
+
* @remarks
|
|
106
|
+
* - Only works for {@link EResourceType.USER_ANALYTICS}.
|
|
107
|
+
*/
|
|
108
|
+
toTime?: Date;
|
|
109
|
+
|
|
110
|
+
/**
|
|
111
|
+
* The granularity of the data to fetch.
|
|
112
|
+
*
|
|
113
|
+
* @remarks
|
|
114
|
+
* - Only works for {@link EResourceType.USER_ANALYTICS}.
|
|
115
|
+
*/
|
|
116
|
+
granularity?: RawAnalyticsGranularity;
|
|
117
|
+
|
|
118
|
+
/**
|
|
119
|
+
* The metrics to fetch.
|
|
120
|
+
*
|
|
121
|
+
* @remarks
|
|
122
|
+
* - Only works for {@link EResourceType.USER_ANALYTICS}.
|
|
123
|
+
*/
|
|
124
|
+
metrics?: RawAnalyticsMetric[];
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* Show the verified follower count and relationship counts in the response.
|
|
128
|
+
*
|
|
129
|
+
* @remarks
|
|
130
|
+
* - Only works for {@link EResourceType.USER_ANALYTICS}.
|
|
131
|
+
*/
|
|
132
|
+
showVerifiedFollowers?: boolean;
|
|
68
133
|
}
|
|
69
134
|
|
|
70
135
|
/**
|