rettiwt-api 6.0.3 → 6.0.4
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.
|
@@ -72,16 +72,35 @@ export declare class UserService extends FetcherService {
|
|
|
72
72
|
*/
|
|
73
73
|
bookmarks(count?: number, cursor?: string): Promise<CursoredData<Tweet>>;
|
|
74
74
|
/**
|
|
75
|
-
* Get the details of
|
|
75
|
+
* Get the details of the logged in user.
|
|
76
76
|
*
|
|
77
|
-
* @
|
|
77
|
+
* @returns The details of the user.
|
|
78
78
|
*
|
|
79
|
-
* @
|
|
80
|
-
* The details of the given user.
|
|
79
|
+
* @example
|
|
81
80
|
*
|
|
82
|
-
*
|
|
81
|
+
* ```ts
|
|
82
|
+
* import { Rettiwt } from 'rettiwt-api';
|
|
83
83
|
*
|
|
84
|
-
*
|
|
84
|
+
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
85
|
+
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
86
|
+
*
|
|
87
|
+
* // Fetching the details of the User
|
|
88
|
+
* rettiwt.user.details()
|
|
89
|
+
* .then(res => {
|
|
90
|
+
* console.log(res);
|
|
91
|
+
* })
|
|
92
|
+
* .catch(err => {
|
|
93
|
+
* console.log(err);
|
|
94
|
+
* });
|
|
95
|
+
* ```
|
|
96
|
+
*/
|
|
97
|
+
details(): Promise<User | undefined>;
|
|
98
|
+
/**
|
|
99
|
+
* Get the details of a user.
|
|
100
|
+
*
|
|
101
|
+
* @param id - The ID/username of the target user.
|
|
102
|
+
*
|
|
103
|
+
* @returns The details of the user.
|
|
85
104
|
*
|
|
86
105
|
* @example
|
|
87
106
|
*
|
|
@@ -120,9 +139,17 @@ export declare class UserService extends FetcherService {
|
|
|
120
139
|
* console.log(err);
|
|
121
140
|
* });
|
|
122
141
|
* ```
|
|
123
|
-
|
|
142
|
+
*/
|
|
143
|
+
details(id: string): Promise<User | undefined>;
|
|
144
|
+
/**
|
|
145
|
+
* Get the details of multiple users in bulk.
|
|
146
|
+
*
|
|
147
|
+
* @param id - The list of IDs of the target users.
|
|
148
|
+
*
|
|
149
|
+
* @returns The details of the users.
|
|
150
|
+
*
|
|
151
|
+
* @example
|
|
124
152
|
*
|
|
125
|
-
* #### Fetching the details of multiple users
|
|
126
153
|
* ```ts
|
|
127
154
|
* import { Rettiwt } from 'rettiwt-api';
|
|
128
155
|
*
|
|
@@ -139,7 +166,7 @@ export declare class UserService extends FetcherService {
|
|
|
139
166
|
* });
|
|
140
167
|
* ```
|
|
141
168
|
*/
|
|
142
|
-
details
|
|
169
|
+
details(id: string[]): Promise<User[]>;
|
|
143
170
|
/**
|
|
144
171
|
* Follow a user.
|
|
145
172
|
*
|
|
@@ -279,7 +306,7 @@ export declare class UserService extends FetcherService {
|
|
|
279
306
|
* });
|
|
280
307
|
* ```
|
|
281
308
|
*/
|
|
282
|
-
highlights(id
|
|
309
|
+
highlights(id?: string, count?: number, cursor?: string): Promise<CursoredData<Tweet>>;
|
|
283
310
|
/**
|
|
284
311
|
* Get the list of tweets liked by the logged in user.
|
|
285
312
|
*
|
|
@@ -457,7 +484,7 @@ export declare class UserService extends FetcherService {
|
|
|
457
484
|
* });
|
|
458
485
|
* ```
|
|
459
486
|
*/
|
|
460
|
-
subscriptions(id
|
|
487
|
+
subscriptions(id?: string, count?: number, cursor?: string): Promise<CursoredData<User>>;
|
|
461
488
|
/**
|
|
462
489
|
* Get the tweet timeline of a user.
|
|
463
490
|
*
|
|
@@ -490,7 +517,7 @@ export declare class UserService extends FetcherService {
|
|
|
490
517
|
* - If the target user has a pinned tweet, the returned timeline has one item extra and this is always the pinned tweet.
|
|
491
518
|
* - If timeline is fetched without authenticating, then the most popular tweets of the target user are returned instead.
|
|
492
519
|
*/
|
|
493
|
-
timeline(id
|
|
520
|
+
timeline(id?: string, count?: number, cursor?: string): Promise<CursoredData<Tweet>>;
|
|
494
521
|
/**
|
|
495
522
|
* Unfollow a user.
|
|
496
523
|
*
|
|
@@ -94,74 +94,6 @@ class UserService extends FetcherService_1.FetcherService {
|
|
|
94
94
|
const data = Extractors_1.Extractors[resource](response);
|
|
95
95
|
return data;
|
|
96
96
|
}
|
|
97
|
-
/**
|
|
98
|
-
* Get the details of a user.
|
|
99
|
-
*
|
|
100
|
-
* @param id - The username/ID/IDs of the target user/users. If no ID is provided, the logged-in user's ID is used.
|
|
101
|
-
*
|
|
102
|
-
* @returns
|
|
103
|
-
* The details of the given user.
|
|
104
|
-
*
|
|
105
|
-
* If more than one ID is provided, returns a list.
|
|
106
|
-
*
|
|
107
|
-
* If no user matches the given id, returns `undefined`.
|
|
108
|
-
*
|
|
109
|
-
* @example
|
|
110
|
-
*
|
|
111
|
-
* #### Fetching the details of a single user using username
|
|
112
|
-
* ```ts
|
|
113
|
-
* import { Rettiwt } from 'rettiwt-api';
|
|
114
|
-
*
|
|
115
|
-
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
116
|
-
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
117
|
-
*
|
|
118
|
-
* // Fetching the details of the User with username 'user1'
|
|
119
|
-
* rettiwt.user.details('user1')
|
|
120
|
-
* .then(res => {
|
|
121
|
-
* console.log(res);
|
|
122
|
-
* })
|
|
123
|
-
* .catch(err => {
|
|
124
|
-
* console.log(err);
|
|
125
|
-
* });
|
|
126
|
-
* ```
|
|
127
|
-
*
|
|
128
|
-
* @example
|
|
129
|
-
*
|
|
130
|
-
* #### Fetching the details of a single user using ID
|
|
131
|
-
* ```ts
|
|
132
|
-
* import { Rettiwt } from 'rettiwt-api';
|
|
133
|
-
*
|
|
134
|
-
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
135
|
-
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
136
|
-
*
|
|
137
|
-
* // Fetching the details of the User with id '1234567890'
|
|
138
|
-
* rettiwt.user.details('1234567890')
|
|
139
|
-
* .then(res => {
|
|
140
|
-
* console.log(res); # 'res' is a single tweet
|
|
141
|
-
* })
|
|
142
|
-
* .catch(err => {
|
|
143
|
-
* console.log(err);
|
|
144
|
-
* });
|
|
145
|
-
* ```
|
|
146
|
-
* * @example
|
|
147
|
-
*
|
|
148
|
-
* #### Fetching the details of multiple users
|
|
149
|
-
* ```ts
|
|
150
|
-
* import { Rettiwt } from 'rettiwt-api';
|
|
151
|
-
*
|
|
152
|
-
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
153
|
-
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
154
|
-
*
|
|
155
|
-
* // Fetching the details of the users with IDs '123', '456', '789'
|
|
156
|
-
* rettiwt.user.details(['123', '456', '789'])
|
|
157
|
-
* .then(res => {
|
|
158
|
-
* console.log(res); # 'res' is an array of users
|
|
159
|
-
* })
|
|
160
|
-
* .catch(err => {
|
|
161
|
-
* console.log(err);
|
|
162
|
-
* });
|
|
163
|
-
* ```
|
|
164
|
-
*/
|
|
165
97
|
async details(id) {
|
|
166
98
|
let resource;
|
|
167
99
|
// If details of multiple users required
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserService.js","sourceRoot":"","sources":["../../../src/services/public/UserService.ts"],"names":[],"mappings":";;;AAAA,6DAA0D;AAC1D,mDAAoD;AAwBpD,qDAAkD;AAElD;;;;GAIG;AACH,MAAa,WAAY,SAAQ,+BAAc;IAC9C;;;;OAIG;IACH,YAAmB,MAAqB;QACvC,KAAK,CAAC,MAAM,CAAC,CAAC;IACf,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;OA0BG;IACI,KAAK,CAAC,UAAU,CAAC,EAAW,EAAE,KAAc,EAAE,MAAe;QACnE,MAAM,QAAQ,GAAG,uBAAY,CAAC,eAAe,CAAC;QAE9C,kCAAkC;QAClC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAA0B,QAAQ,EAAE;YACtE,EAAE,EAAE,EAAE,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM;YAC5B,KAAK,EAAE,KAAK;YACZ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Q,CAAC,CAAC,QAAQ,CAAC,CAAC;QAE5C,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACI,KAAK,CAAC,QAAQ,CAAC,EAAW,EAAE,KAAc,EAAE,MAAe;QACjE,MAAM,QAAQ,GAAG,uBAAY,CAAC,aAAa,CAAC;QAE5C,8BAA8B;QAC9B,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAsB,QAAQ,EAAE;YAClE,EAAE,EAAE,EAAE,IAAI,IAAI,CAAC,MAAM,CAAC,MAAM;YAC5B,KAAK,EAAE,KAAK;YACZ,MAAM,EAAE,MAAM;SACd,CAAC,CAAC;QAEH,yBAAyB;QACzB,MAAM,IAAI,GAAG,uBAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC;QAE5C,OAAO,IAAI,CAAC;IACb,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;OAwBG;IACI,KAAK,CAAC,QAAQ,CAAC,EAAU;QAC/B,MAAM,QAAQ,GAAG,uBAAY,CAAC,aAAa,CAAC;QAE5C,uBAAuB;QACvB,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,OAAO,CAAwB,uBAAY,CAAC,aAAa,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,CAAC;QAEnG,6BAA6B;QAC7B,MAAM,IAAI,GAAG,uBAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,IAAI,KAAK,CAAC;QAErD,OAAO,IAAI,CAAC;IACb,CAAC;CACD;AAlzBD,kCAkzBC"}
|
package/package.json
CHANGED
|
@@ -125,16 +125,36 @@ export class UserService extends FetcherService {
|
|
|
125
125
|
}
|
|
126
126
|
|
|
127
127
|
/**
|
|
128
|
-
* Get the details of
|
|
128
|
+
* Get the details of the logged in user.
|
|
129
|
+
*
|
|
130
|
+
* @returns The details of the user.
|
|
131
|
+
*
|
|
132
|
+
* @example
|
|
133
|
+
*
|
|
134
|
+
* ```ts
|
|
135
|
+
* import { Rettiwt } from 'rettiwt-api';
|
|
129
136
|
*
|
|
130
|
-
*
|
|
137
|
+
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
138
|
+
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
131
139
|
*
|
|
132
|
-
*
|
|
133
|
-
*
|
|
140
|
+
* // Fetching the details of the User
|
|
141
|
+
* rettiwt.user.details()
|
|
142
|
+
* .then(res => {
|
|
143
|
+
* console.log(res);
|
|
144
|
+
* })
|
|
145
|
+
* .catch(err => {
|
|
146
|
+
* console.log(err);
|
|
147
|
+
* });
|
|
148
|
+
* ```
|
|
149
|
+
*/
|
|
150
|
+
public async details(): Promise<User | undefined>;
|
|
151
|
+
|
|
152
|
+
/**
|
|
153
|
+
* Get the details of a user.
|
|
134
154
|
*
|
|
135
|
-
*
|
|
155
|
+
* @param id - The ID/username of the target user.
|
|
136
156
|
*
|
|
137
|
-
*
|
|
157
|
+
* @returns The details of the user.
|
|
138
158
|
*
|
|
139
159
|
* @example
|
|
140
160
|
*
|
|
@@ -173,9 +193,18 @@ export class UserService extends FetcherService {
|
|
|
173
193
|
* console.log(err);
|
|
174
194
|
* });
|
|
175
195
|
* ```
|
|
176
|
-
|
|
196
|
+
*/
|
|
197
|
+
public async details(id: string): Promise<User | undefined>;
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* Get the details of multiple users in bulk.
|
|
201
|
+
*
|
|
202
|
+
* @param id - The list of IDs of the target users.
|
|
203
|
+
*
|
|
204
|
+
* @returns The details of the users.
|
|
205
|
+
*
|
|
206
|
+
* @example
|
|
177
207
|
*
|
|
178
|
-
* #### Fetching the details of multiple users
|
|
179
208
|
* ```ts
|
|
180
209
|
* import { Rettiwt } from 'rettiwt-api';
|
|
181
210
|
*
|
|
@@ -192,9 +221,9 @@ export class UserService extends FetcherService {
|
|
|
192
221
|
* });
|
|
193
222
|
* ```
|
|
194
223
|
*/
|
|
195
|
-
public async details
|
|
196
|
-
|
|
197
|
-
|
|
224
|
+
public async details(id: string[]): Promise<User[]>;
|
|
225
|
+
|
|
226
|
+
public async details(id?: string | string[]): Promise<User | User[] | undefined> {
|
|
198
227
|
let resource: ResourceType;
|
|
199
228
|
|
|
200
229
|
// If details of multiple users required
|
|
@@ -207,7 +236,7 @@ export class UserService extends FetcherService {
|
|
|
207
236
|
// Deserializing response
|
|
208
237
|
const data = Extractors[resource](response, id);
|
|
209
238
|
|
|
210
|
-
return data
|
|
239
|
+
return data;
|
|
211
240
|
}
|
|
212
241
|
// If details of single user required
|
|
213
242
|
else {
|
|
@@ -222,7 +251,7 @@ export class UserService extends FetcherService {
|
|
|
222
251
|
|
|
223
252
|
// If no ID is given, and not authenticated, skip
|
|
224
253
|
if (!id && !this.config.userId) {
|
|
225
|
-
return undefined
|
|
254
|
+
return undefined;
|
|
226
255
|
}
|
|
227
256
|
|
|
228
257
|
// Fetching raw details
|
|
@@ -231,7 +260,7 @@ export class UserService extends FetcherService {
|
|
|
231
260
|
// Deserializing response
|
|
232
261
|
const data = Extractors[resource](response);
|
|
233
262
|
|
|
234
|
-
return data
|
|
263
|
+
return data;
|
|
235
264
|
}
|
|
236
265
|
}
|
|
237
266
|
|
|
@@ -428,7 +457,7 @@ export class UserService extends FetcherService {
|
|
|
428
457
|
* });
|
|
429
458
|
* ```
|
|
430
459
|
*/
|
|
431
|
-
public async highlights(id
|
|
460
|
+
public async highlights(id?: string, count?: number, cursor?: string): Promise<CursoredData<Tweet>> {
|
|
432
461
|
const resource = ResourceType.USER_HIGHLIGHTS;
|
|
433
462
|
|
|
434
463
|
// Fetching raw list of highlights
|
|
@@ -719,7 +748,7 @@ export class UserService extends FetcherService {
|
|
|
719
748
|
* });
|
|
720
749
|
* ```
|
|
721
750
|
*/
|
|
722
|
-
public async subscriptions(id
|
|
751
|
+
public async subscriptions(id?: string, count?: number, cursor?: string): Promise<CursoredData<User>> {
|
|
723
752
|
const resource = ResourceType.USER_SUBSCRIPTIONS;
|
|
724
753
|
|
|
725
754
|
// Fetching raw list of subscriptions
|
|
@@ -767,7 +796,7 @@ export class UserService extends FetcherService {
|
|
|
767
796
|
* - If the target user has a pinned tweet, the returned timeline has one item extra and this is always the pinned tweet.
|
|
768
797
|
* - If timeline is fetched without authenticating, then the most popular tweets of the target user are returned instead.
|
|
769
798
|
*/
|
|
770
|
-
public async timeline(id
|
|
799
|
+
public async timeline(id?: string, count?: number, cursor?: string): Promise<CursoredData<Tweet>> {
|
|
771
800
|
const resource = ResourceType.USER_TIMELINE;
|
|
772
801
|
|
|
773
802
|
// Fetching raw list of tweets
|