rettiwt-api 2.7.1 → 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
|
@@ -52,12 +52,10 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
52
52
|
};
|
|
53
53
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
54
|
exports.UserService = void 0;
|
|
55
|
-
|
|
56
|
-
var
|
|
57
|
-
// SERVICES
|
|
58
|
-
var FetcherService_1 = require("../internal/FetcherService");
|
|
55
|
+
var Resource_1 = require("../../enums/Resource");
|
|
56
|
+
var FetcherService_1 = require("./FetcherService");
|
|
59
57
|
/**
|
|
60
|
-
* Handles
|
|
58
|
+
* Handles interacting with resources related to user account
|
|
61
59
|
*
|
|
62
60
|
* @public
|
|
63
61
|
*/
|
|
@@ -75,9 +73,13 @@ var UserService = /** @class */ (function (_super) {
|
|
|
75
73
|
* Get the details of a user.
|
|
76
74
|
*
|
|
77
75
|
* @param id - The username/id of the target user.
|
|
78
|
-
* @returns The details of the given user.
|
|
79
76
|
*
|
|
80
|
-
* @
|
|
77
|
+
* @returns
|
|
78
|
+
* The details of the given user.
|
|
79
|
+
* If no user matches the given id, returns `undefined`.
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* Fetching the details using username
|
|
81
83
|
* ```
|
|
82
84
|
* import { Rettiwt } from 'rettiwt-api';
|
|
83
85
|
*
|
|
@@ -94,15 +96,16 @@ var UserService = /** @class */ (function (_super) {
|
|
|
94
96
|
* });
|
|
95
97
|
* ```
|
|
96
98
|
*
|
|
97
|
-
* @example
|
|
99
|
+
* @example
|
|
100
|
+
* Fetching the details using id
|
|
98
101
|
* ```
|
|
99
102
|
* import { Rettiwt } from 'rettiwt-api';
|
|
100
103
|
*
|
|
101
104
|
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
102
105
|
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
103
106
|
*
|
|
104
|
-
* // Fetching the details of the User with id '
|
|
105
|
-
* rettiwt.user.details('
|
|
107
|
+
* // Fetching the details of the User with id '1234567890'
|
|
108
|
+
* rettiwt.user.details('1234567890')
|
|
106
109
|
* .then(res => {
|
|
107
110
|
* console.log(res);
|
|
108
111
|
* })
|
|
@@ -110,37 +113,124 @@ var UserService = /** @class */ (function (_super) {
|
|
|
110
113
|
* console.log(err);
|
|
111
114
|
* });
|
|
112
115
|
* ```
|
|
113
|
-
*
|
|
114
|
-
* @public
|
|
115
116
|
*/
|
|
116
117
|
UserService.prototype.details = function (id) {
|
|
117
118
|
return __awaiter(this, void 0, void 0, function () {
|
|
118
|
-
var data;
|
|
119
|
+
var resource, response, data;
|
|
119
120
|
return __generator(this, function (_a) {
|
|
120
121
|
switch (_a.label) {
|
|
121
122
|
case 0:
|
|
122
|
-
|
|
123
|
-
|
|
123
|
+
// If username is given
|
|
124
|
+
if (isNaN(Number(id))) {
|
|
125
|
+
resource = Resource_1.EResourceType.USER_DETAILS_BY_USERNAME;
|
|
126
|
+
}
|
|
127
|
+
// If id is given
|
|
128
|
+
else {
|
|
129
|
+
resource = Resource_1.EResourceType.USER_DETAILS_BY_ID;
|
|
130
|
+
}
|
|
131
|
+
return [4 /*yield*/, this.request(resource, { id: id })];
|
|
124
132
|
case 1:
|
|
125
|
-
|
|
126
|
-
data =
|
|
127
|
-
return [
|
|
128
|
-
case 2: return [4 /*yield*/, this.fetch(rettiwt_core_1.EResourceType.USER_DETAILS_BY_ID, { id: id })];
|
|
129
|
-
case 3:
|
|
130
|
-
// Fetching the requested data
|
|
131
|
-
data = _a.sent();
|
|
132
|
-
_a.label = 4;
|
|
133
|
-
case 4: return [2 /*return*/, data.list[0]];
|
|
133
|
+
response = _a.sent();
|
|
134
|
+
data = this.extract(response, resource);
|
|
135
|
+
return [2 /*return*/, data];
|
|
134
136
|
}
|
|
135
137
|
});
|
|
136
138
|
});
|
|
137
139
|
};
|
|
138
140
|
/**
|
|
139
|
-
*
|
|
141
|
+
* Follow a user.
|
|
142
|
+
*
|
|
143
|
+
* @param id - The id the user to be followed.
|
|
144
|
+
*
|
|
145
|
+
* @returns Whether following was successful or not.
|
|
146
|
+
*
|
|
147
|
+
* @throws Code 108 if given user id is invalid.
|
|
148
|
+
*
|
|
149
|
+
* @example
|
|
150
|
+
* ```
|
|
151
|
+
* import { Rettiwt } from 'rettiwt-api';
|
|
140
152
|
*
|
|
141
|
-
*
|
|
153
|
+
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
154
|
+
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
155
|
+
*
|
|
156
|
+
* // Following the User with id '1234567890'
|
|
157
|
+
* rettiwt.user.follow('1234567890')
|
|
158
|
+
* .then(res => {
|
|
159
|
+
* console.log(res);
|
|
160
|
+
* })
|
|
161
|
+
* .catch(err => {
|
|
162
|
+
* console.log(err);
|
|
163
|
+
* });
|
|
164
|
+
* ```
|
|
165
|
+
*/
|
|
166
|
+
UserService.prototype.follow = function (id) {
|
|
167
|
+
var _a;
|
|
168
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
169
|
+
var response, data;
|
|
170
|
+
return __generator(this, function (_b) {
|
|
171
|
+
switch (_b.label) {
|
|
172
|
+
case 0: return [4 /*yield*/, this.request(Resource_1.EResourceType.USER_FOLLOW, { id: id })];
|
|
173
|
+
case 1:
|
|
174
|
+
response = _b.sent();
|
|
175
|
+
data = (_a = this.extract(response, Resource_1.EResourceType.USER_FOLLOW)) !== null && _a !== void 0 ? _a : false;
|
|
176
|
+
return [2 /*return*/, data];
|
|
177
|
+
}
|
|
178
|
+
});
|
|
179
|
+
});
|
|
180
|
+
};
|
|
181
|
+
/**
|
|
182
|
+
* Get the list followers of a user.
|
|
183
|
+
*
|
|
184
|
+
* @param id - The id of the target user.
|
|
185
|
+
* @param count - The number of followers to fetch, must be \<= 100.
|
|
186
|
+
* @param cursor - The cursor to the batch of followers to fetch.
|
|
187
|
+
*
|
|
188
|
+
* @returns The list of users following the target user.
|
|
189
|
+
*
|
|
190
|
+
* @example
|
|
191
|
+
* ```
|
|
192
|
+
* import { Rettiwt } from 'rettiwt-api';
|
|
193
|
+
*
|
|
194
|
+
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
195
|
+
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
196
|
+
*
|
|
197
|
+
* // Fetching the first 100 followers of the User with id '1234567890'
|
|
198
|
+
* rettiwt.user.followers('1234567890')
|
|
199
|
+
* .then(res => {
|
|
200
|
+
* console.log(res);
|
|
201
|
+
* })
|
|
202
|
+
* .catch(err => {
|
|
203
|
+
* console.log(err);
|
|
204
|
+
* });
|
|
205
|
+
* ```
|
|
206
|
+
*/
|
|
207
|
+
UserService.prototype.followers = function (id, count, cursor) {
|
|
208
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
209
|
+
var resource, response, data;
|
|
210
|
+
return __generator(this, function (_a) {
|
|
211
|
+
switch (_a.label) {
|
|
212
|
+
case 0:
|
|
213
|
+
resource = Resource_1.EResourceType.USER_FOLLOWERS;
|
|
214
|
+
return [4 /*yield*/, this.request(resource, {
|
|
215
|
+
id: id,
|
|
216
|
+
count: count,
|
|
217
|
+
cursor: cursor,
|
|
218
|
+
})];
|
|
219
|
+
case 1:
|
|
220
|
+
response = _a.sent();
|
|
221
|
+
data = this.extract(response, resource);
|
|
222
|
+
return [2 /*return*/, data];
|
|
223
|
+
}
|
|
224
|
+
});
|
|
225
|
+
});
|
|
226
|
+
};
|
|
227
|
+
/**
|
|
228
|
+
* Get the list of users who are followed by a user.
|
|
229
|
+
*
|
|
230
|
+
* @param id - The id of the target user.
|
|
142
231
|
* @param count - The number of following to fetch, must be \<= 100.
|
|
143
232
|
* @param cursor - The cursor to the batch of following to fetch.
|
|
233
|
+
*
|
|
144
234
|
* @returns The list of users followed by the target user.
|
|
145
235
|
*
|
|
146
236
|
* @example
|
|
@@ -150,8 +240,8 @@ var UserService = /** @class */ (function (_super) {
|
|
|
150
240
|
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
151
241
|
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
152
242
|
*
|
|
153
|
-
* // Fetching the first 100 following of the User with id '
|
|
154
|
-
* rettiwt.user.following('
|
|
243
|
+
* // Fetching the first 100 following of the User with id '1234567890'
|
|
244
|
+
* rettiwt.user.following('1234567890')
|
|
155
245
|
* .then(res => {
|
|
156
246
|
* console.log(res);
|
|
157
247
|
* })
|
|
@@ -159,33 +249,35 @@ var UserService = /** @class */ (function (_super) {
|
|
|
159
249
|
* console.log(err);
|
|
160
250
|
* });
|
|
161
251
|
* ```
|
|
162
|
-
*
|
|
163
|
-
* @public
|
|
164
252
|
*/
|
|
165
|
-
UserService.prototype.following = function (
|
|
253
|
+
UserService.prototype.following = function (id, count, cursor) {
|
|
166
254
|
return __awaiter(this, void 0, void 0, function () {
|
|
167
|
-
var data;
|
|
255
|
+
var resource, response, data;
|
|
168
256
|
return __generator(this, function (_a) {
|
|
169
257
|
switch (_a.label) {
|
|
170
|
-
case 0:
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
258
|
+
case 0:
|
|
259
|
+
resource = Resource_1.EResourceType.USER_FOLLOWING;
|
|
260
|
+
return [4 /*yield*/, this.request(resource, {
|
|
261
|
+
id: id,
|
|
262
|
+
count: count,
|
|
263
|
+
cursor: cursor,
|
|
264
|
+
})];
|
|
175
265
|
case 1:
|
|
176
|
-
|
|
266
|
+
response = _a.sent();
|
|
267
|
+
data = this.extract(response, resource);
|
|
177
268
|
return [2 /*return*/, data];
|
|
178
269
|
}
|
|
179
270
|
});
|
|
180
271
|
});
|
|
181
272
|
};
|
|
182
273
|
/**
|
|
183
|
-
* Get the
|
|
274
|
+
* Get the highlighted tweets of a user.
|
|
184
275
|
*
|
|
185
|
-
* @param
|
|
276
|
+
* @param id - The id of the target user.
|
|
186
277
|
* @param count - The number of followers to fetch, must be \<= 100.
|
|
187
278
|
* @param cursor - The cursor to the batch of followers to fetch.
|
|
188
|
-
*
|
|
279
|
+
*
|
|
280
|
+
* @returns The list of highlighted tweets of the target user.
|
|
189
281
|
*
|
|
190
282
|
* @example
|
|
191
283
|
* ```
|
|
@@ -194,8 +286,8 @@ var UserService = /** @class */ (function (_super) {
|
|
|
194
286
|
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
195
287
|
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
196
288
|
*
|
|
197
|
-
* // Fetching the
|
|
198
|
-
* rettiwt.user.
|
|
289
|
+
* // Fetching the top 100 highlights of the User with id '1234567890'
|
|
290
|
+
* rettiwt.user.highlights('1234567890')
|
|
199
291
|
* .then(res => {
|
|
200
292
|
* console.log(res);
|
|
201
293
|
* })
|
|
@@ -203,32 +295,34 @@ var UserService = /** @class */ (function (_super) {
|
|
|
203
295
|
* console.log(err);
|
|
204
296
|
* });
|
|
205
297
|
* ```
|
|
206
|
-
*
|
|
207
|
-
* @public
|
|
208
298
|
*/
|
|
209
|
-
UserService.prototype.
|
|
299
|
+
UserService.prototype.highlights = function (id, count, cursor) {
|
|
210
300
|
return __awaiter(this, void 0, void 0, function () {
|
|
211
|
-
var data;
|
|
301
|
+
var resource, response, data;
|
|
212
302
|
return __generator(this, function (_a) {
|
|
213
303
|
switch (_a.label) {
|
|
214
|
-
case 0:
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
304
|
+
case 0:
|
|
305
|
+
resource = Resource_1.EResourceType.USER_HIGHLIGHTS;
|
|
306
|
+
return [4 /*yield*/, this.request(resource, {
|
|
307
|
+
id: id,
|
|
308
|
+
count: count,
|
|
309
|
+
cursor: cursor,
|
|
310
|
+
})];
|
|
219
311
|
case 1:
|
|
220
|
-
|
|
312
|
+
response = _a.sent();
|
|
313
|
+
data = this.extract(response, resource);
|
|
221
314
|
return [2 /*return*/, data];
|
|
222
315
|
}
|
|
223
316
|
});
|
|
224
317
|
});
|
|
225
318
|
};
|
|
226
319
|
/**
|
|
227
|
-
* Get the list of tweets liked by
|
|
320
|
+
* Get the list of tweets liked by a user.
|
|
228
321
|
*
|
|
229
|
-
* @param
|
|
322
|
+
* @param id - The id of the target user.
|
|
230
323
|
* @param count - The number of likes to fetch, must be \<= 100.
|
|
231
324
|
* @param cursor - The cursor to the batch of likes to fetch.
|
|
325
|
+
*
|
|
232
326
|
* @returns The list of tweets liked by the target user.
|
|
233
327
|
*
|
|
234
328
|
* @example
|
|
@@ -238,8 +332,8 @@ var UserService = /** @class */ (function (_super) {
|
|
|
238
332
|
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
239
333
|
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
240
334
|
*
|
|
241
|
-
* // Fetching the most recent 100 liked Tweets of the User with id '
|
|
242
|
-
* rettiwt.user.likes('
|
|
335
|
+
* // Fetching the most recent 100 liked Tweets of the User with id '1234567890'
|
|
336
|
+
* rettiwt.user.likes('1234567890')
|
|
243
337
|
* .then(res => {
|
|
244
338
|
* console.log(res);
|
|
245
339
|
* })
|
|
@@ -247,33 +341,35 @@ var UserService = /** @class */ (function (_super) {
|
|
|
247
341
|
* console.log(err);
|
|
248
342
|
* });
|
|
249
343
|
* ```
|
|
250
|
-
*
|
|
251
|
-
* @public
|
|
252
344
|
*/
|
|
253
|
-
UserService.prototype.likes = function (
|
|
345
|
+
UserService.prototype.likes = function (id, count, cursor) {
|
|
254
346
|
return __awaiter(this, void 0, void 0, function () {
|
|
255
|
-
var data;
|
|
347
|
+
var resource, response, data;
|
|
256
348
|
return __generator(this, function (_a) {
|
|
257
349
|
switch (_a.label) {
|
|
258
|
-
case 0:
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
350
|
+
case 0:
|
|
351
|
+
resource = Resource_1.EResourceType.USER_LIKES;
|
|
352
|
+
return [4 /*yield*/, this.request(resource, {
|
|
353
|
+
id: id,
|
|
354
|
+
count: count,
|
|
355
|
+
cursor: cursor,
|
|
356
|
+
})];
|
|
263
357
|
case 1:
|
|
264
|
-
|
|
358
|
+
response = _a.sent();
|
|
359
|
+
data = this.extract(response, resource);
|
|
265
360
|
return [2 /*return*/, data];
|
|
266
361
|
}
|
|
267
362
|
});
|
|
268
363
|
});
|
|
269
364
|
};
|
|
270
365
|
/**
|
|
271
|
-
* Get the timeline of
|
|
366
|
+
* Get the media timeline of a user
|
|
272
367
|
*
|
|
273
|
-
* @param
|
|
274
|
-
* @param count - The number of
|
|
275
|
-
* @param cursor - The cursor to the batch of
|
|
276
|
-
*
|
|
368
|
+
* @param id - The id of the target user.
|
|
369
|
+
* @param count - The number of media to fetch, must be \<= 100.
|
|
370
|
+
* @param cursor - The cursor to the batch of media to fetch
|
|
371
|
+
*
|
|
372
|
+
* @returns The media timeline of the target user.
|
|
277
373
|
*
|
|
278
374
|
* @example
|
|
279
375
|
* ```
|
|
@@ -282,8 +378,8 @@ var UserService = /** @class */ (function (_super) {
|
|
|
282
378
|
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
283
379
|
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
284
380
|
*
|
|
285
|
-
* // Fetching the first
|
|
286
|
-
* rettiwt.user.timeline('
|
|
381
|
+
* // Fetching the first 100 timeline media tweets of the User with id '1234567890'
|
|
382
|
+
* rettiwt.user.timeline('1234567890')
|
|
287
383
|
* .then(res => {
|
|
288
384
|
* console.log(res);
|
|
289
385
|
* })
|
|
@@ -291,36 +387,34 @@ var UserService = /** @class */ (function (_super) {
|
|
|
291
387
|
* console.log(err);
|
|
292
388
|
* });
|
|
293
389
|
* ```
|
|
294
|
-
*
|
|
295
|
-
* @remarks
|
|
296
|
-
* - If the target user has a pinned tweet, the returned timeline has one item extra and this is always the pinned tweet.
|
|
297
|
-
* - If timeline is fetched without authenticating, then the most popular tweets of the target user are returned instead.
|
|
298
|
-
*
|
|
299
|
-
* @public
|
|
300
390
|
*/
|
|
301
|
-
UserService.prototype.
|
|
391
|
+
UserService.prototype.media = function (id, count, cursor) {
|
|
302
392
|
return __awaiter(this, void 0, void 0, function () {
|
|
303
|
-
var data;
|
|
393
|
+
var resource, response, data;
|
|
304
394
|
return __generator(this, function (_a) {
|
|
305
395
|
switch (_a.label) {
|
|
306
|
-
case 0:
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
396
|
+
case 0:
|
|
397
|
+
resource = Resource_1.EResourceType.USER_MEDIA;
|
|
398
|
+
return [4 /*yield*/, this.request(resource, {
|
|
399
|
+
id: id,
|
|
400
|
+
count: count,
|
|
401
|
+
cursor: cursor,
|
|
402
|
+
})];
|
|
311
403
|
case 1:
|
|
312
|
-
|
|
404
|
+
response = _a.sent();
|
|
405
|
+
data = this.extract(response, resource);
|
|
313
406
|
return [2 /*return*/, data];
|
|
314
407
|
}
|
|
315
408
|
});
|
|
316
409
|
});
|
|
317
410
|
};
|
|
318
411
|
/**
|
|
319
|
-
* Get the reply timeline of
|
|
412
|
+
* Get the reply timeline of a user.
|
|
320
413
|
*
|
|
321
|
-
* @param
|
|
414
|
+
* @param id - The id of the target user.
|
|
322
415
|
* @param count - The number of replies to fetch, must be \<= 20.
|
|
323
416
|
* @param cursor - The cursor to the batch of replies to fetch.
|
|
417
|
+
*
|
|
324
418
|
* @returns The reply timeline of the target user.
|
|
325
419
|
*
|
|
326
420
|
* @example
|
|
@@ -330,8 +424,8 @@ var UserService = /** @class */ (function (_super) {
|
|
|
330
424
|
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
331
425
|
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
332
426
|
*
|
|
333
|
-
* // Fetching the first 100 timeline replies of the User with id '
|
|
334
|
-
* rettiwt.user.replies('
|
|
427
|
+
* // Fetching the first 100 timeline replies of the User with id '1234567890'
|
|
428
|
+
* rettiwt.user.replies('1234567890')
|
|
335
429
|
* .then(res => {
|
|
336
430
|
* console.log(res);
|
|
337
431
|
* })
|
|
@@ -341,23 +435,159 @@ var UserService = /** @class */ (function (_super) {
|
|
|
341
435
|
* ```
|
|
342
436
|
*
|
|
343
437
|
* @remarks If the target user has a pinned tweet, the returned reply timeline has one item extra and this is always the pinned tweet.
|
|
438
|
+
*/
|
|
439
|
+
UserService.prototype.replies = function (id, count, cursor) {
|
|
440
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
441
|
+
var resource, response, data;
|
|
442
|
+
return __generator(this, function (_a) {
|
|
443
|
+
switch (_a.label) {
|
|
444
|
+
case 0:
|
|
445
|
+
resource = Resource_1.EResourceType.USER_TIMELINE_AND_REPLIES;
|
|
446
|
+
return [4 /*yield*/, this.request(resource, {
|
|
447
|
+
id: id,
|
|
448
|
+
count: count,
|
|
449
|
+
cursor: cursor,
|
|
450
|
+
})];
|
|
451
|
+
case 1:
|
|
452
|
+
response = _a.sent();
|
|
453
|
+
data = this.extract(response, resource);
|
|
454
|
+
return [2 /*return*/, data];
|
|
455
|
+
}
|
|
456
|
+
});
|
|
457
|
+
});
|
|
458
|
+
};
|
|
459
|
+
/**
|
|
460
|
+
* Get the list of subscriptions of a user.
|
|
461
|
+
*
|
|
462
|
+
* @param id - The id of the target user.
|
|
463
|
+
* @param count - The number of subscriptions to fetch, must be \<= 100.
|
|
464
|
+
* @param cursor - The cursor to the batch of subscriptions to fetch.
|
|
465
|
+
*
|
|
466
|
+
* @returns The list of subscriptions by the target user.
|
|
467
|
+
*
|
|
468
|
+
* @example
|
|
469
|
+
* ```
|
|
470
|
+
* import { Rettiwt } from 'rettiwt-api';
|
|
471
|
+
*
|
|
472
|
+
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
473
|
+
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
474
|
+
*
|
|
475
|
+
* // Fetching the first 100 subscriptions of the User with id '1234567890'
|
|
476
|
+
* rettiwt.user.subscriptions('1234567890')
|
|
477
|
+
* .then(res => {
|
|
478
|
+
* console.log(res);
|
|
479
|
+
* })
|
|
480
|
+
* .catch(err => {
|
|
481
|
+
* console.log(err);
|
|
482
|
+
* });
|
|
483
|
+
* ```
|
|
484
|
+
*/
|
|
485
|
+
UserService.prototype.subscriptions = function (id, count, cursor) {
|
|
486
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
487
|
+
var resource, response, data;
|
|
488
|
+
return __generator(this, function (_a) {
|
|
489
|
+
switch (_a.label) {
|
|
490
|
+
case 0:
|
|
491
|
+
resource = Resource_1.EResourceType.USER_SUBSCRIPTIONS;
|
|
492
|
+
return [4 /*yield*/, this.request(resource, {
|
|
493
|
+
id: id,
|
|
494
|
+
count: count,
|
|
495
|
+
cursor: cursor,
|
|
496
|
+
})];
|
|
497
|
+
case 1:
|
|
498
|
+
response = _a.sent();
|
|
499
|
+
data = this.extract(response, resource);
|
|
500
|
+
return [2 /*return*/, data];
|
|
501
|
+
}
|
|
502
|
+
});
|
|
503
|
+
});
|
|
504
|
+
};
|
|
505
|
+
/**
|
|
506
|
+
* Get the tweet timeline of a user.
|
|
507
|
+
*
|
|
508
|
+
* @param id - The id of the target user.
|
|
509
|
+
* @param count - The number of timeline items to fetch, must be \<= 20.
|
|
510
|
+
* @param cursor - The cursor to the batch of timeline items to fetch.
|
|
511
|
+
*
|
|
512
|
+
* @returns The timeline of the target user.
|
|
513
|
+
*
|
|
514
|
+
* @example
|
|
515
|
+
* ```
|
|
516
|
+
* import { Rettiwt } from 'rettiwt-api';
|
|
517
|
+
*
|
|
518
|
+
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
519
|
+
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
520
|
+
*
|
|
521
|
+
* // Fetching the first 20 timeline tweets of the User with id '1234567890'
|
|
522
|
+
* rettiwt.user.timeline('1234567890')
|
|
523
|
+
* .then(res => {
|
|
524
|
+
* console.log(res);
|
|
525
|
+
* })
|
|
526
|
+
* .catch(err => {
|
|
527
|
+
* console.log(err);
|
|
528
|
+
* });
|
|
529
|
+
* ```
|
|
344
530
|
*
|
|
345
|
-
* @
|
|
531
|
+
* @remarks
|
|
532
|
+
* - If the target user has a pinned tweet, the returned timeline has one item extra and this is always the pinned tweet.
|
|
533
|
+
* - If timeline is fetched without authenticating, then the most popular tweets of the target user are returned instead.
|
|
346
534
|
*/
|
|
347
|
-
UserService.prototype.
|
|
535
|
+
UserService.prototype.timeline = function (id, count, cursor) {
|
|
348
536
|
return __awaiter(this, void 0, void 0, function () {
|
|
349
|
-
var data;
|
|
537
|
+
var resource, response, data;
|
|
350
538
|
return __generator(this, function (_a) {
|
|
351
539
|
switch (_a.label) {
|
|
352
|
-
case 0:
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
540
|
+
case 0:
|
|
541
|
+
resource = Resource_1.EResourceType.USER_TIMELINE;
|
|
542
|
+
return [4 /*yield*/, this.request(resource, {
|
|
543
|
+
id: id,
|
|
544
|
+
count: count,
|
|
545
|
+
cursor: cursor,
|
|
546
|
+
})];
|
|
547
|
+
case 1:
|
|
548
|
+
response = _a.sent();
|
|
549
|
+
data = this.extract(response, resource);
|
|
550
|
+
return [2 /*return*/, data];
|
|
551
|
+
}
|
|
552
|
+
});
|
|
553
|
+
});
|
|
554
|
+
};
|
|
555
|
+
/**
|
|
556
|
+
* Unfollow a user.
|
|
557
|
+
*
|
|
558
|
+
* @param id - The id the user to be unfollowed.
|
|
559
|
+
*
|
|
560
|
+
* @returns Whether unfollowing was successful or not.
|
|
561
|
+
*
|
|
562
|
+
* @throws Code 34 if given user id is invalid.
|
|
563
|
+
*
|
|
564
|
+
* @example
|
|
565
|
+
* ```
|
|
566
|
+
* import { Rettiwt } from 'rettiwt-api';
|
|
567
|
+
*
|
|
568
|
+
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
569
|
+
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
570
|
+
*
|
|
571
|
+
* // Unfollowing the User with id '12345678'
|
|
572
|
+
* rettiwt.user.unfollow('12345678')
|
|
573
|
+
* .then(res => {
|
|
574
|
+
* console.log(res);
|
|
575
|
+
* })
|
|
576
|
+
* .catch(err => {
|
|
577
|
+
* console.log(err);
|
|
578
|
+
* });
|
|
579
|
+
* ```
|
|
580
|
+
*/
|
|
581
|
+
UserService.prototype.unfollow = function (id) {
|
|
582
|
+
var _a;
|
|
583
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
584
|
+
var response, data;
|
|
585
|
+
return __generator(this, function (_b) {
|
|
586
|
+
switch (_b.label) {
|
|
587
|
+
case 0: return [4 /*yield*/, this.request(Resource_1.EResourceType.USER_UNFOLLOW, { id: id })];
|
|
357
588
|
case 1:
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
data.list = data.list.filter(function (tweet) { return tweet.tweetBy.id == userId; });
|
|
589
|
+
response = _b.sent();
|
|
590
|
+
data = (_a = this.extract(response, Resource_1.EResourceType.USER_UNFOLLOW)) !== null && _a !== void 0 ? _a : false;
|
|
361
591
|
return [2 /*return*/, data];
|
|
362
592
|
}
|
|
363
593
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"UserService.js","sourceRoot":"","sources":["../../../src/services/public/UserService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
|
|
1
|
+
{"version":3,"file":"UserService.js","sourceRoot":"","sources":["../../../src/services/public/UserService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAcA,iDAAqD;AAMrD,mDAAkD;AAElD;;;;GAIG;AACH;IAAiC,+BAAc;IAC9C;;;;OAIG;IACH,qBAAmB,MAAuB;eACzC,kBAAM,MAAM,CAAC;IACd,CAAC;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA4CG;IACU,6BAAO,GAApB,UAAqB,EAAU;;;;;;wBAG9B,uBAAuB;wBACvB,IAAI,KAAK,CAAC,MAAM,CAAC,EAAE,CAAC,CAAC,EAAE;4BACtB,QAA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,IAAI,GAAG,IAAI,CAAC,OAAO,CAAqB,QAAQ,EAAE,QAAQ,CAAE,CAAC;wBAEnE,sBAAO,IAAI,EAAC;;;;KACZ;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACU,8BAAQ,GAArB,UAAsB,EAAU,EAAE,KAAc,EAAE,MAAe;;;;;;wBAC1D,QAAQ,GAAG,wBAAa,CAAC,aAAa,CAAC;wBAG5B,qBAAM,IAAI,CAAC,OAAO,CAAsB,QAAQ,EAAE;gCAClE,EAAE,EAAE,EAAE;gCACN,KAAK,EAAE,KAAK;gCACZ,MAAM,EAAE,MAAM;6BACd,CAAC,EAAA;;wBAJI,QAAQ,GAAG,SAIf;wBAGI,IAAI,GAAG,IAAI,CAAC,OAAO,CAAsB,QAAQ,EAAE,QAAQ,CAAE,CAAC;wBAEpE,sBAAO,IAAI,EAAC;;;;KACZ;IAED;;;;;;;;;;;;;;;;;;;;;;;;;OAyBG;IACU,8BAAQ,GAArB,UAAsB,EAAU;;;;;;4BAEd,qBAAM,IAAI,CAAC,OAAO,CAAwB,wBAAa,CAAC,aAAa,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAA;;wBAA7F,QAAQ,GAAG,SAAkF;wBAG7F,IAAI,GAAG,MAAA,IAAI,CAAC,OAAO,CAAU,QAAQ,EAAE,wBAAa,CAAC,aAAa,CAAC,mCAAI,KAAK,CAAC;wBAEnF,sBAAO,IAAI,EAAC;;;;KACZ;IACF,kBAAC;AAAD,CAAC,AAzeD,CAAiC,+BAAc,GAye9C;AAzeY,kCAAW"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { CursoredData } from '../models/data/CursoredData';
|
|
2
|
+
import { Tweet } from '../models/data/Tweet';
|
|
3
|
+
import { User } from '../models/data/User';
|
|
4
|
+
/**
|
|
5
|
+
* Collection of all return types.
|
|
6
|
+
*
|
|
7
|
+
* @internal
|
|
8
|
+
*/
|
|
9
|
+
export type AllReturnTypes = boolean | CursoredData<Tweet> | CursoredData<User> | string | Tweet | User;
|
|
10
|
+
/**
|
|
11
|
+
* Return type of fetch requests.
|
|
12
|
+
*
|
|
13
|
+
* @internal
|
|
14
|
+
*/
|
|
15
|
+
export type FetchReturnType = boolean | CursoredData<Tweet> | CursoredData<User> | Tweet | User;
|
|
16
|
+
/**
|
|
17
|
+
* Return type of post requests.
|
|
18
|
+
*
|
|
19
|
+
* @internal
|
|
20
|
+
*/
|
|
21
|
+
export type PostReturnType = boolean;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"ReturnTypes.js","sourceRoot":"","sources":["../../src/types/ReturnTypes.ts"],"names":[],"mappings":""}
|