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.
Files changed (139) hide show
  1. package/.eslintrc.js +73 -5
  2. package/.tool-versions +1 -0
  3. package/README.md +87 -20
  4. package/dist/Rettiwt.js +0 -1
  5. package/dist/Rettiwt.js.map +1 -1
  6. package/dist/cli.js +2 -4
  7. package/dist/cli.js.map +1 -1
  8. package/dist/collections/Extractors.d.ts +10 -0
  9. package/dist/collections/Extractors.js +43 -0
  10. package/dist/collections/Extractors.js.map +1 -0
  11. package/dist/collections/Groups.d.ts +19 -0
  12. package/dist/collections/Groups.js +55 -0
  13. package/dist/collections/Groups.js.map +1 -0
  14. package/dist/collections/Requests.d.ts +12 -0
  15. package/dist/collections/Requests.js +46 -0
  16. package/dist/collections/Requests.js.map +1 -0
  17. package/dist/commands/Auth.d.ts +6 -0
  18. package/dist/commands/Auth.js +26 -8
  19. package/dist/commands/Auth.js.map +1 -1
  20. package/dist/commands/Tweet.js +237 -82
  21. package/dist/commands/Tweet.js.map +1 -1
  22. package/dist/commands/User.js +197 -36
  23. package/dist/commands/User.js.map +1 -1
  24. package/dist/enums/Api.d.ts +30 -0
  25. package/dist/enums/Api.js +32 -1
  26. package/dist/enums/Api.js.map +1 -1
  27. package/dist/enums/Data.d.ts +9 -0
  28. package/dist/enums/Data.js +14 -0
  29. package/dist/enums/Data.js.map +1 -0
  30. package/dist/enums/Http.d.ts +1 -1
  31. package/dist/enums/Http.js +1 -1
  32. package/dist/enums/Logging.d.ts +6 -5
  33. package/dist/enums/Logging.js +6 -5
  34. package/dist/enums/Logging.js.map +1 -1
  35. package/dist/enums/Resource.d.ts +33 -0
  36. package/dist/enums/Resource.js +42 -0
  37. package/dist/enums/Resource.js.map +1 -0
  38. package/dist/helper/CliUtils.d.ts +1 -1
  39. package/dist/helper/CliUtils.js.map +1 -1
  40. package/dist/index.d.ts +11 -9
  41. package/dist/index.js +11 -14
  42. package/dist/index.js.map +1 -1
  43. package/dist/models/args/FetchArgs.d.ts +129 -0
  44. package/dist/models/args/FetchArgs.js +263 -0
  45. package/dist/models/args/FetchArgs.js.map +1 -0
  46. package/dist/models/args/PostArgs.d.ts +116 -0
  47. package/dist/models/args/PostArgs.js +232 -0
  48. package/dist/models/args/PostArgs.js.map +1 -0
  49. package/dist/models/data/CursoredData.d.ts +11 -11
  50. package/dist/models/data/CursoredData.js +21 -16
  51. package/dist/models/data/CursoredData.js.map +1 -1
  52. package/dist/models/data/List.d.ts +8 -10
  53. package/dist/models/data/List.js +2 -4
  54. package/dist/models/data/List.js.map +1 -1
  55. package/dist/models/data/Tweet.d.ts +41 -29
  56. package/dist/models/data/Tweet.js +71 -15
  57. package/dist/models/data/Tweet.js.map +1 -1
  58. package/dist/models/data/User.d.ts +36 -20
  59. package/dist/models/data/User.js +69 -7
  60. package/dist/models/data/User.js.map +1 -1
  61. package/dist/models/errors/ApiError.d.ts +1 -3
  62. package/dist/models/errors/ApiError.js +1 -4
  63. package/dist/models/errors/ApiError.js.map +1 -1
  64. package/dist/models/errors/DataValidationError.d.ts +30 -0
  65. package/dist/models/errors/DataValidationError.js +34 -0
  66. package/dist/models/errors/DataValidationError.js.map +1 -0
  67. package/dist/models/errors/HttpError.d.ts +1 -3
  68. package/dist/models/errors/HttpError.js +1 -4
  69. package/dist/models/errors/HttpError.js.map +1 -1
  70. package/dist/models/errors/TimeoutError.d.ts +2 -4
  71. package/dist/models/errors/TimeoutError.js +2 -5
  72. package/dist/models/errors/TimeoutError.js.map +1 -1
  73. package/dist/services/internal/ErrorService.d.ts +45 -35
  74. package/dist/services/internal/ErrorService.js +70 -68
  75. package/dist/services/internal/ErrorService.js.map +1 -1
  76. package/dist/services/internal/LogService.d.ts +7 -5
  77. package/dist/services/internal/LogService.js +28 -9
  78. package/dist/services/internal/LogService.js.map +1 -1
  79. package/dist/services/public/AuthService.d.ts +24 -20
  80. package/dist/services/public/AuthService.js +38 -36
  81. package/dist/services/public/AuthService.js.map +1 -1
  82. package/dist/services/public/FetcherService.d.ts +99 -0
  83. package/dist/services/public/FetcherService.js +254 -0
  84. package/dist/services/public/FetcherService.js.map +1 -0
  85. package/dist/services/public/TweetService.d.ts +213 -94
  86. package/dist/services/public/TweetService.js +405 -208
  87. package/dist/services/public/TweetService.js.map +1 -1
  88. package/dist/services/public/UserService.d.ts +185 -52
  89. package/dist/services/public/UserService.js +333 -103
  90. package/dist/services/public/UserService.js.map +1 -1
  91. package/dist/types/ReturnTypes.d.ts +21 -0
  92. package/dist/types/ReturnTypes.js +3 -0
  93. package/dist/types/ReturnTypes.js.map +1 -0
  94. package/package.json +4 -2
  95. package/src/Rettiwt.ts +0 -3
  96. package/src/cli.ts +2 -4
  97. package/src/collections/Extractors.ts +63 -0
  98. package/src/collections/Groups.ts +54 -0
  99. package/src/collections/Requests.ts +52 -0
  100. package/src/commands/Auth.ts +19 -7
  101. package/src/commands/Tweet.ts +179 -91
  102. package/src/commands/User.ts +118 -25
  103. package/src/enums/Api.ts +31 -0
  104. package/src/enums/Data.ts +9 -0
  105. package/src/enums/Http.ts +1 -1
  106. package/src/enums/Logging.ts +6 -5
  107. package/src/enums/Resource.ts +40 -0
  108. package/src/helper/CliUtils.ts +1 -1
  109. package/src/index.ts +41 -14
  110. package/src/models/args/FetchArgs.ts +296 -0
  111. package/src/models/args/PostArgs.ts +263 -0
  112. package/src/models/data/CursoredData.ts +23 -15
  113. package/src/models/data/List.ts +12 -15
  114. package/src/models/data/Tweet.ts +105 -39
  115. package/src/models/data/User.ts +97 -30
  116. package/src/models/errors/ApiError.ts +1 -4
  117. package/src/models/errors/DataValidationError.ts +44 -0
  118. package/src/models/errors/HttpError.ts +1 -4
  119. package/src/models/errors/TimeoutError.ts +2 -5
  120. package/src/services/internal/ErrorService.ts +76 -75
  121. package/src/services/internal/LogService.ts +20 -10
  122. package/src/services/public/AuthService.ts +39 -38
  123. package/src/services/public/FetcherService.ts +230 -0
  124. package/src/services/public/TweetService.ts +381 -179
  125. package/src/services/public/UserService.ts +314 -86
  126. package/src/types/RettiwtConfig.ts +0 -1
  127. package/src/types/ReturnTypes.ts +24 -0
  128. package/dist/models/args/TweetArgs.d.ts +0 -44
  129. package/dist/models/args/TweetArgs.js +0 -82
  130. package/dist/models/args/TweetArgs.js.map +0 -1
  131. package/dist/models/data/Media.d.ts +0 -14
  132. package/dist/models/data/Media.js +0 -19
  133. package/dist/models/data/Media.js.map +0 -1
  134. package/dist/services/internal/FetcherService.d.ts +0 -106
  135. package/dist/services/internal/FetcherService.js +0 -365
  136. package/dist/services/internal/FetcherService.js.map +0 -1
  137. package/src/models/args/TweetArgs.ts +0 -98
  138. package/src/models/data/Media.ts +0 -19
  139. 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,WAAW;AACX,6CAAqE;AAErE,WAAW;AACX,6DAA4D;AAS5D,yDAAwE;AAExE;;;;GAIG;AACH;IAAkC,gCAAc;IAC/C;;;;OAIG;IACH,sBAAmB,MAAuB;eACzC,kBAAM,MAAM,CAAC;IACd,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACU,8BAAO,GAApB,UAAqB,EAAU;;;;;4BAEjB,qBAAM,IAAI,CAAC,KAAK,CAAQ,4BAAa,CAAC,aAAa,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAA;;wBAAvE,IAAI,GAAG,SAAgE;wBAE7E,sBAAO,IAAI,CAAC,IAAI,CAAC,CAAC,CAAC,EAAC;;;;KACpB;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4BG;IACU,6BAAM,GAAnB,UAAoB,KAAkB,EAAE,KAAc,EAAE,MAAe;;;;;4BAEzD,qBA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KAAK,CAAC,UAAU,CAAC;wBAE/E,qBAAM,IAAI,CAAC,OAAO,CAAiC,wBAAa,CAAC,uBAAuB,EAAE;gCACzF,MAAM,EAAE,EAAE,IAAI,EAAE,IAAI,EAAE;6BACtB,CAAC,EAAA;;wBAHG,EAAE,GAAW,CAClB,SAEE,CACF,CAAC,eAAe;wBAEjB,SAAS;wBACT,qBAAM,IAAI,CAAC,OAAO,CAAU,wBAAa,CAAC,mBAAmB,EAAE,EAAE,MAAM,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,KAAK,EAAE,KAAK,EAAE,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 fetching of data related to user account
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
- * @example Fetching the details of the Twitter user with username 'user1'
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 Fetching the details of the Twitter user with id '12345678'
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
- * // Fetching the details of the User with id '12345678'
49
- * rettiwt.user.details('12345678')
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
- * @public
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
- details(id: string): Promise<User>;
117
+ followers(id: string, count?: number, cursor?: string): Promise<CursoredData<User>>;
61
118
  /**
62
- * Get the list of users who are followed by the given user.
119
+ * Get the list of users who are followed by a user.
63
120
  *
64
- * @param userId - The rest id of the target user.
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 '12345678'
77
- * rettiwt.user.following('12345678')
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(userId: string, count?: number, cursor?: string): Promise<CursoredData<User>>;
144
+ following(id: string, count?: number, cursor?: string): Promise<CursoredData<User>>;
89
145
  /**
90
- * Get the list followers of a given user.
146
+ * Get the highlighted tweets of a user.
91
147
  *
92
- * @param userId - The rest id of the target user.
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
- * @returns The list of users following the target user.
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 first 100 followers of the User with id '12345678'
105
- * rettiwt.user.followers('12345678')
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
- followers(userId: string, count?: number, cursor?: string): Promise<CursoredData<User>>;
171
+ highlights(id: string, count?: number, cursor?: string): Promise<CursoredData<Tweet>>;
117
172
  /**
118
- * Get the list of tweets liked by the given user.
173
+ * Get the list of tweets liked by a user.
119
174
  *
120
- * @param userId - The rest id of the target user.
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 '12345678'
133
- * rettiwt.user.likes('12345678')
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
- * @public
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
- likes(userId: string, count?: number, cursor?: string): Promise<CursoredData<Tweet>>;
225
+ media(id: string, count?: number, cursor?: string): Promise<CursoredData<Tweet>>;
145
226
  /**
146
- * Get the timeline of the given user.
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
- * @param userId - The rest id of the target user.
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 '12345678'
161
- * rettiwt.user.timeline('12345678')
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(userId: string, count?: number, cursor?: string): Promise<CursoredData<Tweet>>;
312
+ timeline(id: string, count?: number, cursor?: string): Promise<CursoredData<Tweet>>;
177
313
  /**
178
- * Get the reply timeline of the given user.
314
+ * Unfollow a user.
179
315
  *
180
- * @param userId - The rest id of the target user.
181
- * @param count - The number of replies to fetch, must be \<= 20.
182
- * @param cursor - The cursor to the batch of replies to fetch.
183
- * @returns The reply timeline of the target user.
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
- * // Fetching the first 100 timeline replies of the User with id '12345678'
193
- * rettiwt.user.replies('12345678')
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
- replies(userId: string, count?: number, cursor?: string): Promise<CursoredData<Tweet>>;
339
+ unfollow(id: string): Promise<boolean>;
207
340
  }