rettiwt-api 2.7.0 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.eslintrc.js +73 -5
- package/.tool-versions +1 -0
- package/README.md +87 -20
- package/dist/Rettiwt.js +0 -1
- package/dist/Rettiwt.js.map +1 -1
- package/dist/cli.js +2 -4
- package/dist/cli.js.map +1 -1
- package/dist/collections/Extractors.d.ts +10 -0
- package/dist/collections/Extractors.js +43 -0
- package/dist/collections/Extractors.js.map +1 -0
- package/dist/collections/Groups.d.ts +19 -0
- package/dist/collections/Groups.js +55 -0
- package/dist/collections/Groups.js.map +1 -0
- package/dist/collections/Requests.d.ts +12 -0
- package/dist/collections/Requests.js +46 -0
- package/dist/collections/Requests.js.map +1 -0
- package/dist/commands/Auth.d.ts +6 -0
- package/dist/commands/Auth.js +26 -8
- package/dist/commands/Auth.js.map +1 -1
- package/dist/commands/Tweet.js +237 -82
- package/dist/commands/Tweet.js.map +1 -1
- package/dist/commands/User.js +197 -36
- package/dist/commands/User.js.map +1 -1
- package/dist/enums/Api.d.ts +30 -0
- package/dist/enums/Api.js +32 -1
- package/dist/enums/Api.js.map +1 -1
- package/dist/enums/Data.d.ts +9 -0
- package/dist/enums/Data.js +14 -0
- package/dist/enums/Data.js.map +1 -0
- package/dist/enums/Http.d.ts +1 -1
- package/dist/enums/Http.js +1 -1
- package/dist/enums/Logging.d.ts +6 -5
- package/dist/enums/Logging.js +6 -5
- package/dist/enums/Logging.js.map +1 -1
- package/dist/enums/Resource.d.ts +33 -0
- package/dist/enums/Resource.js +42 -0
- package/dist/enums/Resource.js.map +1 -0
- package/dist/helper/CliUtils.d.ts +1 -1
- package/dist/helper/CliUtils.js.map +1 -1
- package/dist/index.d.ts +11 -9
- package/dist/index.js +11 -14
- package/dist/index.js.map +1 -1
- package/dist/models/args/FetchArgs.d.ts +129 -0
- package/dist/models/args/FetchArgs.js +263 -0
- package/dist/models/args/FetchArgs.js.map +1 -0
- package/dist/models/args/PostArgs.d.ts +116 -0
- package/dist/models/args/PostArgs.js +232 -0
- package/dist/models/args/PostArgs.js.map +1 -0
- package/dist/models/data/CursoredData.d.ts +11 -11
- package/dist/models/data/CursoredData.js +21 -16
- package/dist/models/data/CursoredData.js.map +1 -1
- package/dist/models/data/List.d.ts +8 -10
- package/dist/models/data/List.js +2 -4
- package/dist/models/data/List.js.map +1 -1
- package/dist/models/data/Tweet.d.ts +41 -29
- package/dist/models/data/Tweet.js +71 -15
- package/dist/models/data/Tweet.js.map +1 -1
- package/dist/models/data/User.d.ts +36 -20
- package/dist/models/data/User.js +69 -7
- package/dist/models/data/User.js.map +1 -1
- package/dist/models/errors/ApiError.d.ts +1 -3
- package/dist/models/errors/ApiError.js +1 -4
- package/dist/models/errors/ApiError.js.map +1 -1
- package/dist/models/errors/DataValidationError.d.ts +30 -0
- package/dist/models/errors/DataValidationError.js +34 -0
- package/dist/models/errors/DataValidationError.js.map +1 -0
- package/dist/models/errors/HttpError.d.ts +1 -3
- package/dist/models/errors/HttpError.js +1 -4
- package/dist/models/errors/HttpError.js.map +1 -1
- package/dist/models/errors/TimeoutError.d.ts +2 -4
- package/dist/models/errors/TimeoutError.js +2 -5
- package/dist/models/errors/TimeoutError.js.map +1 -1
- package/dist/services/internal/ErrorService.d.ts +45 -35
- package/dist/services/internal/ErrorService.js +70 -68
- package/dist/services/internal/ErrorService.js.map +1 -1
- package/dist/services/internal/LogService.d.ts +7 -5
- package/dist/services/internal/LogService.js +28 -9
- package/dist/services/internal/LogService.js.map +1 -1
- package/dist/services/public/AuthService.d.ts +24 -20
- package/dist/services/public/AuthService.js +38 -36
- package/dist/services/public/AuthService.js.map +1 -1
- package/dist/services/public/FetcherService.d.ts +99 -0
- package/dist/services/public/FetcherService.js +254 -0
- package/dist/services/public/FetcherService.js.map +1 -0
- package/dist/services/public/TweetService.d.ts +213 -94
- package/dist/services/public/TweetService.js +405 -208
- package/dist/services/public/TweetService.js.map +1 -1
- package/dist/services/public/UserService.d.ts +185 -52
- package/dist/services/public/UserService.js +333 -103
- package/dist/services/public/UserService.js.map +1 -1
- package/dist/types/ReturnTypes.d.ts +21 -0
- package/dist/types/ReturnTypes.js +3 -0
- package/dist/types/ReturnTypes.js.map +1 -0
- package/package.json +4 -2
- package/src/Rettiwt.ts +0 -3
- package/src/cli.ts +2 -4
- package/src/collections/Extractors.ts +63 -0
- package/src/collections/Groups.ts +54 -0
- package/src/collections/Requests.ts +52 -0
- package/src/commands/Auth.ts +19 -7
- package/src/commands/Tweet.ts +179 -91
- package/src/commands/User.ts +118 -25
- package/src/enums/Api.ts +31 -0
- package/src/enums/Data.ts +9 -0
- package/src/enums/Http.ts +1 -1
- package/src/enums/Logging.ts +6 -5
- package/src/enums/Resource.ts +40 -0
- package/src/helper/CliUtils.ts +1 -1
- package/src/index.ts +41 -14
- package/src/models/args/FetchArgs.ts +296 -0
- package/src/models/args/PostArgs.ts +263 -0
- package/src/models/data/CursoredData.ts +23 -15
- package/src/models/data/List.ts +12 -15
- package/src/models/data/Tweet.ts +105 -39
- package/src/models/data/User.ts +97 -30
- package/src/models/errors/ApiError.ts +1 -4
- package/src/models/errors/DataValidationError.ts +44 -0
- package/src/models/errors/HttpError.ts +1 -4
- package/src/models/errors/TimeoutError.ts +2 -5
- package/src/services/internal/ErrorService.ts +76 -75
- package/src/services/internal/LogService.ts +20 -10
- package/src/services/public/AuthService.ts +39 -38
- package/src/services/public/FetcherService.ts +230 -0
- package/src/services/public/TweetService.ts +381 -179
- package/src/services/public/UserService.ts +314 -86
- package/src/types/RettiwtConfig.ts +0 -1
- package/src/types/ReturnTypes.ts +24 -0
- package/dist/models/args/TweetArgs.d.ts +0 -44
- package/dist/models/args/TweetArgs.js +0 -82
- package/dist/models/args/TweetArgs.js.map +0 -1
- package/dist/models/data/Media.d.ts +0 -14
- package/dist/models/data/Media.js +0 -19
- package/dist/models/data/Media.js.map +0 -1
- package/dist/services/internal/FetcherService.d.ts +0 -106
- package/dist/services/internal/FetcherService.js +0 -365
- package/dist/services/internal/FetcherService.js.map +0 -1
- package/src/models/args/TweetArgs.ts +0 -98
- package/src/models/data/Media.ts +0 -19
- package/src/services/internal/FetcherService.ts +0 -365
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TweetService.js","sourceRoot":"","sources":["../../../src/services/public/TweetService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,
|
|
1
|
+
{"version":3,"file":"TweetService.js","sourceRoot":"","sources":["../../../src/services/public/TweetService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yBAA8B;AAkB9B,iDAAqD;AAOrD,mDAAkD;AAElD;;;;GAIG;AACH;IAAkC,gCAAc;IAC/C;;;;OAIG;IACH,sBAAmB,MAAuB;eACzC,kBAAM,MAAM,CAAC;IACd,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACU,8BAAO,GAApB,UAAqB,EAAU;;;;;;wBACxB,QAAQ,GAAG,wBAAa,CAAC,aAAa,CAAC;wBAG5B,qBAAM,IAAI,CAAC,OAAO,CAAwB,QAAQ,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAA;;wBAA1E,QAAQ,GAAG,SAA+D;wBAG1E,IAAI,GAAG,IAAI,CAAC,OAAO,CAAQ,QAAQ,EAAE,QAAQ,CAAC,CAAC;wBAErD,sBAAO,IAAI,EAAC;;;;KACZ;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACU,2BAAI,GAAjB,UAAkB,EAAU;;;;;;4BAEV,qBAAM,IAAI,CAAC,OAAO,CAAqB,wBAAa,CAAC,UAAU,EAAE;4BACjF,EAAE,EAAE,EAAE;yBACN,CAAC,EAAA;;wBAFI,QAAQ,GAAG,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E,EAAE,CAAC,EAAA;;wBADpG,SAAS;wBACT,SAAoG,CAAC;wBAErG,WAAW;wBACX,qBAAM,IAAI,CAAC,OAAO,CAAU,wBAAa,CAAC,qBAAqB,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAA;;wBADxF,WAAW;wBACX,SAAwF,CAAC;wBAEzF,sBAAO,EAAE,EAAC;;;;KACV;IACF,mBAAC;AAAD,CAAC,AA/lBD,CAAkC,+BAAc,GA+lB/C;AA/lBY,oCAAY"}
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import { FetcherService } from '../internal/FetcherService';
|
|
2
|
-
import { IRettiwtConfig } from '../../types/RettiwtConfig';
|
|
3
|
-
import { User } from '../../models/data/User';
|
|
4
|
-
import { Tweet } from '../../models/data/Tweet';
|
|
5
1
|
import { CursoredData } from '../../models/data/CursoredData';
|
|
2
|
+
import { Tweet } from '../../models/data/Tweet';
|
|
3
|
+
import { User } from '../../models/data/User';
|
|
4
|
+
import { IRettiwtConfig } from '../../types/RettiwtConfig';
|
|
5
|
+
import { FetcherService } from './FetcherService';
|
|
6
6
|
/**
|
|
7
|
-
* Handles
|
|
7
|
+
* Handles interacting with resources related to user account
|
|
8
8
|
*
|
|
9
9
|
* @public
|
|
10
10
|
*/
|
|
@@ -19,9 +19,13 @@ export declare class UserService extends FetcherService {
|
|
|
19
19
|
* Get the details of a user.
|
|
20
20
|
*
|
|
21
21
|
* @param id - The username/id of the target user.
|
|
22
|
-
* @returns The details of the given user.
|
|
23
22
|
*
|
|
24
|
-
* @
|
|
23
|
+
* @returns
|
|
24
|
+
* The details of the given user.
|
|
25
|
+
* If no user matches the given id, returns `undefined`.
|
|
26
|
+
*
|
|
27
|
+
* @example
|
|
28
|
+
* Fetching the details using username
|
|
25
29
|
* ```
|
|
26
30
|
* import { Rettiwt } from 'rettiwt-api';
|
|
27
31
|
*
|
|
@@ -38,15 +42,43 @@ export declare class UserService extends FetcherService {
|
|
|
38
42
|
* });
|
|
39
43
|
* ```
|
|
40
44
|
*
|
|
41
|
-
* @example
|
|
45
|
+
* @example
|
|
46
|
+
* Fetching the details using id
|
|
47
|
+
* ```
|
|
48
|
+
* import { Rettiwt } from 'rettiwt-api';
|
|
49
|
+
*
|
|
50
|
+
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
51
|
+
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
52
|
+
*
|
|
53
|
+
* // Fetching the details of the User with id '1234567890'
|
|
54
|
+
* rettiwt.user.details('1234567890')
|
|
55
|
+
* .then(res => {
|
|
56
|
+
* console.log(res);
|
|
57
|
+
* })
|
|
58
|
+
* .catch(err => {
|
|
59
|
+
* console.log(err);
|
|
60
|
+
* });
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
details(id: string): Promise<User | undefined>;
|
|
64
|
+
/**
|
|
65
|
+
* Follow a user.
|
|
66
|
+
*
|
|
67
|
+
* @param id - The id the user to be followed.
|
|
68
|
+
*
|
|
69
|
+
* @returns Whether following was successful or not.
|
|
70
|
+
*
|
|
71
|
+
* @throws Code 108 if given user id is invalid.
|
|
72
|
+
*
|
|
73
|
+
* @example
|
|
42
74
|
* ```
|
|
43
75
|
* import { Rettiwt } from 'rettiwt-api';
|
|
44
76
|
*
|
|
45
77
|
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
46
78
|
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
47
79
|
*
|
|
48
|
-
* //
|
|
49
|
-
* rettiwt.user.
|
|
80
|
+
* // Following the User with id '1234567890'
|
|
81
|
+
* rettiwt.user.follow('1234567890')
|
|
50
82
|
* .then(res => {
|
|
51
83
|
* console.log(res);
|
|
52
84
|
* })
|
|
@@ -54,16 +86,42 @@ export declare class UserService extends FetcherService {
|
|
|
54
86
|
* console.log(err);
|
|
55
87
|
* });
|
|
56
88
|
* ```
|
|
89
|
+
*/
|
|
90
|
+
follow(id: string): Promise<boolean>;
|
|
91
|
+
/**
|
|
92
|
+
* Get the list followers of a user.
|
|
93
|
+
*
|
|
94
|
+
* @param id - The id of the target user.
|
|
95
|
+
* @param count - The number of followers to fetch, must be \<= 100.
|
|
96
|
+
* @param cursor - The cursor to the batch of followers to fetch.
|
|
97
|
+
*
|
|
98
|
+
* @returns The list of users following the target user.
|
|
99
|
+
*
|
|
100
|
+
* @example
|
|
101
|
+
* ```
|
|
102
|
+
* import { Rettiwt } from 'rettiwt-api';
|
|
57
103
|
*
|
|
58
|
-
*
|
|
104
|
+
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
105
|
+
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
106
|
+
*
|
|
107
|
+
* // Fetching the first 100 followers of the User with id '1234567890'
|
|
108
|
+
* rettiwt.user.followers('1234567890')
|
|
109
|
+
* .then(res => {
|
|
110
|
+
* console.log(res);
|
|
111
|
+
* })
|
|
112
|
+
* .catch(err => {
|
|
113
|
+
* console.log(err);
|
|
114
|
+
* });
|
|
115
|
+
* ```
|
|
59
116
|
*/
|
|
60
|
-
|
|
117
|
+
followers(id: string, count?: number, cursor?: string): Promise<CursoredData<User>>;
|
|
61
118
|
/**
|
|
62
|
-
* Get the list of users who are followed by
|
|
119
|
+
* Get the list of users who are followed by a user.
|
|
63
120
|
*
|
|
64
|
-
* @param
|
|
121
|
+
* @param id - The id of the target user.
|
|
65
122
|
* @param count - The number of following to fetch, must be \<= 100.
|
|
66
123
|
* @param cursor - The cursor to the batch of following to fetch.
|
|
124
|
+
*
|
|
67
125
|
* @returns The list of users followed by the target user.
|
|
68
126
|
*
|
|
69
127
|
* @example
|
|
@@ -73,8 +131,8 @@ export declare class UserService extends FetcherService {
|
|
|
73
131
|
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
74
132
|
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
75
133
|
*
|
|
76
|
-
* // Fetching the first 100 following of the User with id '
|
|
77
|
-
* rettiwt.user.following('
|
|
134
|
+
* // Fetching the first 100 following of the User with id '1234567890'
|
|
135
|
+
* rettiwt.user.following('1234567890')
|
|
78
136
|
* .then(res => {
|
|
79
137
|
* console.log(res);
|
|
80
138
|
* })
|
|
@@ -82,17 +140,16 @@ export declare class UserService extends FetcherService {
|
|
|
82
140
|
* console.log(err);
|
|
83
141
|
* });
|
|
84
142
|
* ```
|
|
85
|
-
*
|
|
86
|
-
* @public
|
|
87
143
|
*/
|
|
88
|
-
following(
|
|
144
|
+
following(id: string, count?: number, cursor?: string): Promise<CursoredData<User>>;
|
|
89
145
|
/**
|
|
90
|
-
* Get the
|
|
146
|
+
* Get the highlighted tweets of a user.
|
|
91
147
|
*
|
|
92
|
-
* @param
|
|
148
|
+
* @param id - The id of the target user.
|
|
93
149
|
* @param count - The number of followers to fetch, must be \<= 100.
|
|
94
150
|
* @param cursor - The cursor to the batch of followers to fetch.
|
|
95
|
-
*
|
|
151
|
+
*
|
|
152
|
+
* @returns The list of highlighted tweets of the target user.
|
|
96
153
|
*
|
|
97
154
|
* @example
|
|
98
155
|
* ```
|
|
@@ -101,8 +158,8 @@ export declare class UserService extends FetcherService {
|
|
|
101
158
|
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
102
159
|
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
103
160
|
*
|
|
104
|
-
* // Fetching the
|
|
105
|
-
* rettiwt.user.
|
|
161
|
+
* // Fetching the top 100 highlights of the User with id '1234567890'
|
|
162
|
+
* rettiwt.user.highlights('1234567890')
|
|
106
163
|
* .then(res => {
|
|
107
164
|
* console.log(res);
|
|
108
165
|
* })
|
|
@@ -110,16 +167,15 @@ export declare class UserService extends FetcherService {
|
|
|
110
167
|
* console.log(err);
|
|
111
168
|
* });
|
|
112
169
|
* ```
|
|
113
|
-
*
|
|
114
|
-
* @public
|
|
115
170
|
*/
|
|
116
|
-
|
|
171
|
+
highlights(id: string, count?: number, cursor?: string): Promise<CursoredData<Tweet>>;
|
|
117
172
|
/**
|
|
118
|
-
* Get the list of tweets liked by
|
|
173
|
+
* Get the list of tweets liked by a user.
|
|
119
174
|
*
|
|
120
|
-
* @param
|
|
175
|
+
* @param id - The id of the target user.
|
|
121
176
|
* @param count - The number of likes to fetch, must be \<= 100.
|
|
122
177
|
* @param cursor - The cursor to the batch of likes to fetch.
|
|
178
|
+
*
|
|
123
179
|
* @returns The list of tweets liked by the target user.
|
|
124
180
|
*
|
|
125
181
|
* @example
|
|
@@ -129,8 +185,8 @@ export declare class UserService extends FetcherService {
|
|
|
129
185
|
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
130
186
|
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
131
187
|
*
|
|
132
|
-
* // Fetching the most recent 100 liked Tweets of the User with id '
|
|
133
|
-
* rettiwt.user.likes('
|
|
188
|
+
* // Fetching the most recent 100 liked Tweets of the User with id '1234567890'
|
|
189
|
+
* rettiwt.user.likes('1234567890')
|
|
134
190
|
* .then(res => {
|
|
135
191
|
* console.log(res);
|
|
136
192
|
* })
|
|
@@ -138,16 +194,98 @@ export declare class UserService extends FetcherService {
|
|
|
138
194
|
* console.log(err);
|
|
139
195
|
* });
|
|
140
196
|
* ```
|
|
197
|
+
*/
|
|
198
|
+
likes(id: string, count?: number, cursor?: string): Promise<CursoredData<Tweet>>;
|
|
199
|
+
/**
|
|
200
|
+
* Get the media timeline of a user
|
|
201
|
+
*
|
|
202
|
+
* @param id - The id of the target user.
|
|
203
|
+
* @param count - The number of media to fetch, must be \<= 100.
|
|
204
|
+
* @param cursor - The cursor to the batch of media to fetch
|
|
205
|
+
*
|
|
206
|
+
* @returns The media timeline of the target user.
|
|
207
|
+
*
|
|
208
|
+
* @example
|
|
209
|
+
* ```
|
|
210
|
+
* import { Rettiwt } from 'rettiwt-api';
|
|
141
211
|
*
|
|
142
|
-
*
|
|
212
|
+
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
213
|
+
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
214
|
+
*
|
|
215
|
+
* // Fetching the first 100 timeline media tweets of the User with id '1234567890'
|
|
216
|
+
* rettiwt.user.timeline('1234567890')
|
|
217
|
+
* .then(res => {
|
|
218
|
+
* console.log(res);
|
|
219
|
+
* })
|
|
220
|
+
* .catch(err => {
|
|
221
|
+
* console.log(err);
|
|
222
|
+
* });
|
|
223
|
+
* ```
|
|
143
224
|
*/
|
|
144
|
-
|
|
225
|
+
media(id: string, count?: number, cursor?: string): Promise<CursoredData<Tweet>>;
|
|
145
226
|
/**
|
|
146
|
-
* Get the timeline of
|
|
227
|
+
* Get the reply timeline of a user.
|
|
228
|
+
*
|
|
229
|
+
* @param id - The id of the target user.
|
|
230
|
+
* @param count - The number of replies to fetch, must be \<= 20.
|
|
231
|
+
* @param cursor - The cursor to the batch of replies to fetch.
|
|
232
|
+
*
|
|
233
|
+
* @returns The reply timeline of the target user.
|
|
234
|
+
*
|
|
235
|
+
* @example
|
|
236
|
+
* ```
|
|
237
|
+
* import { Rettiwt } from 'rettiwt-api';
|
|
238
|
+
*
|
|
239
|
+
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
240
|
+
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
241
|
+
*
|
|
242
|
+
* // Fetching the first 100 timeline replies of the User with id '1234567890'
|
|
243
|
+
* rettiwt.user.replies('1234567890')
|
|
244
|
+
* .then(res => {
|
|
245
|
+
* console.log(res);
|
|
246
|
+
* })
|
|
247
|
+
* .catch(err => {
|
|
248
|
+
* console.log(err);
|
|
249
|
+
* });
|
|
250
|
+
* ```
|
|
147
251
|
*
|
|
148
|
-
* @
|
|
252
|
+
* @remarks If the target user has a pinned tweet, the returned reply timeline has one item extra and this is always the pinned tweet.
|
|
253
|
+
*/
|
|
254
|
+
replies(id: string, count?: number, cursor?: string): Promise<CursoredData<Tweet>>;
|
|
255
|
+
/**
|
|
256
|
+
* Get the list of subscriptions of a user.
|
|
257
|
+
*
|
|
258
|
+
* @param id - The id of the target user.
|
|
259
|
+
* @param count - The number of subscriptions to fetch, must be \<= 100.
|
|
260
|
+
* @param cursor - The cursor to the batch of subscriptions to fetch.
|
|
261
|
+
*
|
|
262
|
+
* @returns The list of subscriptions by the target user.
|
|
263
|
+
*
|
|
264
|
+
* @example
|
|
265
|
+
* ```
|
|
266
|
+
* import { Rettiwt } from 'rettiwt-api';
|
|
267
|
+
*
|
|
268
|
+
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
269
|
+
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
270
|
+
*
|
|
271
|
+
* // Fetching the first 100 subscriptions of the User with id '1234567890'
|
|
272
|
+
* rettiwt.user.subscriptions('1234567890')
|
|
273
|
+
* .then(res => {
|
|
274
|
+
* console.log(res);
|
|
275
|
+
* })
|
|
276
|
+
* .catch(err => {
|
|
277
|
+
* console.log(err);
|
|
278
|
+
* });
|
|
279
|
+
* ```
|
|
280
|
+
*/
|
|
281
|
+
subscriptions(id: string, count?: number, cursor?: string): Promise<CursoredData<User>>;
|
|
282
|
+
/**
|
|
283
|
+
* Get the tweet timeline of a user.
|
|
284
|
+
*
|
|
285
|
+
* @param id - The id of the target user.
|
|
149
286
|
* @param count - The number of timeline items to fetch, must be \<= 20.
|
|
150
287
|
* @param cursor - The cursor to the batch of timeline items to fetch.
|
|
288
|
+
*
|
|
151
289
|
* @returns The timeline of the target user.
|
|
152
290
|
*
|
|
153
291
|
* @example
|
|
@@ -157,8 +295,8 @@ export declare class UserService extends FetcherService {
|
|
|
157
295
|
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
158
296
|
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
159
297
|
*
|
|
160
|
-
* // Fetching the first 20 timeline tweets of the User with id '
|
|
161
|
-
* rettiwt.user.timeline('
|
|
298
|
+
* // Fetching the first 20 timeline tweets of the User with id '1234567890'
|
|
299
|
+
* rettiwt.user.timeline('1234567890')
|
|
162
300
|
* .then(res => {
|
|
163
301
|
* console.log(res);
|
|
164
302
|
* })
|
|
@@ -170,17 +308,16 @@ export declare class UserService extends FetcherService {
|
|
|
170
308
|
* @remarks
|
|
171
309
|
* - If the target user has a pinned tweet, the returned timeline has one item extra and this is always the pinned tweet.
|
|
172
310
|
* - If timeline is fetched without authenticating, then the most popular tweets of the target user are returned instead.
|
|
173
|
-
*
|
|
174
|
-
* @public
|
|
175
311
|
*/
|
|
176
|
-
timeline(
|
|
312
|
+
timeline(id: string, count?: number, cursor?: string): Promise<CursoredData<Tweet>>;
|
|
177
313
|
/**
|
|
178
|
-
*
|
|
314
|
+
* Unfollow a user.
|
|
179
315
|
*
|
|
180
|
-
* @param
|
|
181
|
-
*
|
|
182
|
-
* @
|
|
183
|
-
*
|
|
316
|
+
* @param id - The id the user to be unfollowed.
|
|
317
|
+
*
|
|
318
|
+
* @returns Whether unfollowing was successful or not.
|
|
319
|
+
*
|
|
320
|
+
* @throws Code 34 if given user id is invalid.
|
|
184
321
|
*
|
|
185
322
|
* @example
|
|
186
323
|
* ```
|
|
@@ -189,8 +326,8 @@ export declare class UserService extends FetcherService {
|
|
|
189
326
|
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
190
327
|
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
191
328
|
*
|
|
192
|
-
* //
|
|
193
|
-
* rettiwt.user.
|
|
329
|
+
* // Unfollowing the User with id '12345678'
|
|
330
|
+
* rettiwt.user.unfollow('12345678')
|
|
194
331
|
* .then(res => {
|
|
195
332
|
* console.log(res);
|
|
196
333
|
* })
|
|
@@ -198,10 +335,6 @@ export declare class UserService extends FetcherService {
|
|
|
198
335
|
* console.log(err);
|
|
199
336
|
* });
|
|
200
337
|
* ```
|
|
201
|
-
*
|
|
202
|
-
* @remarks If the target user has a pinned tweet, the returned reply timeline has one item extra and this is always the pinned tweet.
|
|
203
|
-
*
|
|
204
|
-
* @public
|
|
205
338
|
*/
|
|
206
|
-
|
|
339
|
+
unfollow(id: string): Promise<boolean>;
|
|
207
340
|
}
|