rettiwt-api 4.0.0 → 4.1.0-alpha.1
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/workflows/publish-alpha.yml +29 -0
- package/dist/collections/Extractors.d.ts +3 -1
- package/dist/collections/Extractors.js +3 -0
- package/dist/collections/Extractors.js.map +1 -1
- package/dist/collections/Groups.js +1 -0
- package/dist/collections/Groups.js.map +1 -1
- package/dist/collections/Requests.js +1 -0
- package/dist/collections/Requests.js.map +1 -1
- package/dist/enums/Data.d.ts +1 -0
- package/dist/enums/Data.js +1 -0
- package/dist/enums/Data.js.map +1 -1
- package/dist/enums/Resource.d.ts +1 -0
- package/dist/enums/Resource.js +1 -0
- package/dist/enums/Resource.js.map +1 -1
- package/dist/helper/JsonUtils.js +1 -1
- package/dist/helper/JsonUtils.js.map +1 -1
- package/dist/models/args/FetchArgs.js +13 -1
- package/dist/models/args/FetchArgs.js.map +1 -1
- package/dist/models/data/CursoredData.d.ts +3 -3
- package/dist/models/data/CursoredData.js +11 -3
- package/dist/models/data/CursoredData.js.map +1 -1
- package/dist/models/data/Notification.d.ts +46 -0
- package/dist/models/data/Notification.js +69 -0
- package/dist/models/data/Notification.js.map +1 -0
- package/dist/models/data/Tweet.d.ts +3 -3
- package/dist/models/data/Tweet.js.map +1 -1
- package/dist/models/data/User.d.ts +3 -3
- package/dist/models/data/User.js.map +1 -1
- package/dist/services/public/TweetService.d.ts +7 -3
- package/dist/services/public/TweetService.js +7 -3
- package/dist/services/public/TweetService.js.map +1 -1
- package/dist/services/public/UserService.d.ts +34 -1
- package/dist/services/public/UserService.js +97 -1
- package/dist/services/public/UserService.js.map +1 -1
- package/package.json +2 -2
- package/src/collections/Extractors.ts +4 -0
- package/src/collections/Groups.ts +1 -0
- package/src/collections/Requests.ts +1 -0
- package/src/enums/Data.ts +1 -0
- package/src/enums/Resource.ts +1 -0
- package/src/helper/JsonUtils.ts +1 -1
- package/src/models/args/FetchArgs.ts +13 -1
- package/src/models/data/CursoredData.ts +11 -7
- package/src/models/data/Notification.ts +91 -0
- package/src/models/data/Tweet.ts +2 -3
- package/src/models/data/User.ts +3 -3
- package/src/services/public/TweetService.ts +7 -3
- package/src/services/public/UserService.ts +75 -1
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"TweetService.js","sourceRoot":"","sources":["../../../src/services/public/TweetService.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,yBAA8B;AAoB9B,2DAA0D;AAC1D,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;;;;;;6BAI1B,CAAA,IAAI,CAAC,MAAM,IAAI,SAAS,CAAA,EAAxB,wBAAwB;wBAC3B,QAAQ,GAAG,wBAAa,CAAC,iBAAiB,CAAC;wBAG1B,qBAAM,IAAI,CAAC,OAAO,CAAwB,QAAQ,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAA;;wBAA1E,QAAQ,GAAG,SAA+D;wBAG1E,IAAI,GAAG,uBAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;wBAEhD,sBAAO,IAAI,EAAC;;wBAIZ,QAAQ,GAAG,wBAAa,CAAC,aAAa,CAAC;wBAGtB,qBAAM,IAAI,CAAC,OAAO,CAAwB,QAAQ,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAA;;wBAA1E,QAAQ,GAAG,SAA+D;wBAG1E,IAAI,GAAG,uBAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,EAAE,EAAE,CAAC,CAAC;wBAEhD,sBAAO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,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,AAxpBD,CAAkC,+BAAc,GAwpB/C;AAxpBY,oCAAY"}
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { CursoredData } from '../../models/data/CursoredData';
|
|
2
|
+
import { Notification } from '../../models/data/Notification';
|
|
2
3
|
import { Tweet } from '../../models/data/Tweet';
|
|
3
4
|
import { User } from '../../models/data/User';
|
|
4
5
|
import { IRettiwtConfig } from '../../types/RettiwtConfig';
|
|
@@ -223,7 +224,7 @@ export declare class UserService extends FetcherService {
|
|
|
223
224
|
*/
|
|
224
225
|
likes(count?: number, cursor?: string): Promise<CursoredData<Tweet>>;
|
|
225
226
|
/**
|
|
226
|
-
* Get the media timeline of a user
|
|
227
|
+
* Get the media timeline of a user.
|
|
227
228
|
*
|
|
228
229
|
* @param id - The id of the target user.
|
|
229
230
|
* @param count - The number of media to fetch, must be \<= 100.
|
|
@@ -249,6 +250,38 @@ export declare class UserService extends FetcherService {
|
|
|
249
250
|
* ```
|
|
250
251
|
*/
|
|
251
252
|
media(id: string, count?: number, cursor?: string): Promise<CursoredData<Tweet>>;
|
|
253
|
+
/**
|
|
254
|
+
* Stream notifications of the logged in user in pseudo real-time.
|
|
255
|
+
*
|
|
256
|
+
* @param pollingInterval - The interval in milliseconds to poll for new tweets. Default interval is 60000 ms.
|
|
257
|
+
*
|
|
258
|
+
* @returns An async generator that yields new notifications as they are received.
|
|
259
|
+
*
|
|
260
|
+
* @example
|
|
261
|
+
* ```
|
|
262
|
+
* import { Rettiwt } from 'rettiwt-api';
|
|
263
|
+
*
|
|
264
|
+
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
265
|
+
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
266
|
+
*
|
|
267
|
+
* // Creating a function that streams all new notifications
|
|
268
|
+
* async function streamNotifications() {
|
|
269
|
+
* try {
|
|
270
|
+
* // Awaiting for the notifications returned by the AsyncGenerator returned by the method
|
|
271
|
+
* for await (const notification of rettiwt.user.notifications(1000)) {
|
|
272
|
+
* console.log(notification.message);
|
|
273
|
+
* }
|
|
274
|
+
* }
|
|
275
|
+
* catch (err) {
|
|
276
|
+
* console.log(err);
|
|
277
|
+
* }
|
|
278
|
+
* }
|
|
279
|
+
*
|
|
280
|
+
* // Calling the function
|
|
281
|
+
* streamNotifications();
|
|
282
|
+
* ```
|
|
283
|
+
*/
|
|
284
|
+
notifications(pollingInterval?: number): AsyncGenerator<Notification>;
|
|
252
285
|
/**
|
|
253
286
|
* Get the recommended feed of the logged in user.
|
|
254
287
|
*
|
|
@@ -50,6 +50,18 @@ var __generator = (this && this.__generator) || function (thisArg, body) {
|
|
|
50
50
|
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
51
51
|
}
|
|
52
52
|
};
|
|
53
|
+
var __await = (this && this.__await) || function (v) { return this instanceof __await ? (this.v = v, this) : new __await(v); }
|
|
54
|
+
var __asyncGenerator = (this && this.__asyncGenerator) || function (thisArg, _arguments, generator) {
|
|
55
|
+
if (!Symbol.asyncIterator) throw new TypeError("Symbol.asyncIterator is not defined.");
|
|
56
|
+
var g = generator.apply(thisArg, _arguments || []), i, q = [];
|
|
57
|
+
return i = {}, verb("next"), verb("throw"), verb("return"), i[Symbol.asyncIterator] = function () { return this; }, i;
|
|
58
|
+
function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }
|
|
59
|
+
function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }
|
|
60
|
+
function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }
|
|
61
|
+
function fulfill(value) { resume("next", value); }
|
|
62
|
+
function reject(value) { resume("throw", value); }
|
|
63
|
+
function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }
|
|
64
|
+
};
|
|
53
65
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
54
66
|
exports.UserService = void 0;
|
|
55
67
|
var Extractors_1 = require("../../collections/Extractors");
|
|
@@ -409,7 +421,7 @@ var UserService = /** @class */ (function (_super) {
|
|
|
409
421
|
});
|
|
410
422
|
};
|
|
411
423
|
/**
|
|
412
|
-
* Get the media timeline of a user
|
|
424
|
+
* Get the media timeline of a user.
|
|
413
425
|
*
|
|
414
426
|
* @param id - The id of the target user.
|
|
415
427
|
* @param count - The number of media to fetch, must be \<= 100.
|
|
@@ -454,6 +466,90 @@ var UserService = /** @class */ (function (_super) {
|
|
|
454
466
|
});
|
|
455
467
|
});
|
|
456
468
|
};
|
|
469
|
+
/**
|
|
470
|
+
* Stream notifications of the logged in user in pseudo real-time.
|
|
471
|
+
*
|
|
472
|
+
* @param pollingInterval - The interval in milliseconds to poll for new tweets. Default interval is 60000 ms.
|
|
473
|
+
*
|
|
474
|
+
* @returns An async generator that yields new notifications as they are received.
|
|
475
|
+
*
|
|
476
|
+
* @example
|
|
477
|
+
* ```
|
|
478
|
+
* import { Rettiwt } from 'rettiwt-api';
|
|
479
|
+
*
|
|
480
|
+
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
481
|
+
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
482
|
+
*
|
|
483
|
+
* // Creating a function that streams all new notifications
|
|
484
|
+
* async function streamNotifications() {
|
|
485
|
+
* try {
|
|
486
|
+
* // Awaiting for the notifications returned by the AsyncGenerator returned by the method
|
|
487
|
+
* for await (const notification of rettiwt.user.notifications(1000)) {
|
|
488
|
+
* console.log(notification.message);
|
|
489
|
+
* }
|
|
490
|
+
* }
|
|
491
|
+
* catch (err) {
|
|
492
|
+
* console.log(err);
|
|
493
|
+
* }
|
|
494
|
+
* }
|
|
495
|
+
*
|
|
496
|
+
* // Calling the function
|
|
497
|
+
* streamNotifications();
|
|
498
|
+
* ```
|
|
499
|
+
*/
|
|
500
|
+
UserService.prototype.notifications = function (pollingInterval) {
|
|
501
|
+
if (pollingInterval === void 0) { pollingInterval = 60000; }
|
|
502
|
+
return __asyncGenerator(this, arguments, function notifications_1() {
|
|
503
|
+
var resource, first, cursor, response, notifications, _i, _a, notification;
|
|
504
|
+
return __generator(this, function (_b) {
|
|
505
|
+
switch (_b.label) {
|
|
506
|
+
case 0:
|
|
507
|
+
resource = Resource_1.EResourceType.USER_NOTIFICATIONS;
|
|
508
|
+
first = true;
|
|
509
|
+
cursor = undefined;
|
|
510
|
+
_b.label = 1;
|
|
511
|
+
case 1:
|
|
512
|
+
if (!true) return [3 /*break*/, 11];
|
|
513
|
+
// Pause execution for the specified polling interval before proceeding to the next iteration
|
|
514
|
+
return [4 /*yield*/, __await(new Promise(function (resolve) { return setTimeout(resolve, pollingInterval); }))];
|
|
515
|
+
case 2:
|
|
516
|
+
// Pause execution for the specified polling interval before proceeding to the next iteration
|
|
517
|
+
_b.sent();
|
|
518
|
+
return [4 /*yield*/, __await(this.request(resource, {
|
|
519
|
+
count: 40,
|
|
520
|
+
cursor: cursor,
|
|
521
|
+
}))];
|
|
522
|
+
case 3:
|
|
523
|
+
response = _b.sent();
|
|
524
|
+
notifications = Extractors_1.extractors[resource](response);
|
|
525
|
+
// Sorting the notifications by time, from oldest to recent
|
|
526
|
+
notifications.list.sort(function (a, b) { return new Date(a.receivedAt).valueOf() - new Date(b.receivedAt).valueOf(); });
|
|
527
|
+
if (!!first) return [3 /*break*/, 9];
|
|
528
|
+
_i = 0, _a = notifications.list;
|
|
529
|
+
_b.label = 4;
|
|
530
|
+
case 4:
|
|
531
|
+
if (!(_i < _a.length)) return [3 /*break*/, 8];
|
|
532
|
+
notification = _a[_i];
|
|
533
|
+
return [4 /*yield*/, __await(notification)];
|
|
534
|
+
case 5: return [4 /*yield*/, _b.sent()];
|
|
535
|
+
case 6:
|
|
536
|
+
_b.sent();
|
|
537
|
+
_b.label = 7;
|
|
538
|
+
case 7:
|
|
539
|
+
_i++;
|
|
540
|
+
return [3 /*break*/, 4];
|
|
541
|
+
case 8: return [3 /*break*/, 10];
|
|
542
|
+
case 9:
|
|
543
|
+
first = false;
|
|
544
|
+
_b.label = 10;
|
|
545
|
+
case 10:
|
|
546
|
+
cursor = notifications.next.value;
|
|
547
|
+
return [3 /*break*/, 1];
|
|
548
|
+
case 11: return [2 /*return*/];
|
|
549
|
+
}
|
|
550
|
+
});
|
|
551
|
+
});
|
|
552
|
+
};
|
|
457
553
|
/**
|
|
458
554
|
* Get the recommended feed of the logged in user.
|
|
459
555
|
*
|
|
@@ -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":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAiBA,2DAA0D;AAC1D,iDAAqD;AAOrD,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,QAAQ,GAAG,wBAAa,CAAC,wBAAwB,CAAC;yBAClD;wBACD,iBAAiB;6BACZ;4B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,GAAG,wBAAa,CAAC,aAAa,CAAC;wBAG5B,qBAAM,IAAI,CAAC,OAAO,CAAwB,wBAAa,CAAC,aAAa,EAAE,EAAE,EAAE,EAAE,EAAE,EAAE,CAAC,EAAA;;wBAA7F,QAAQ,GAAG,SAAkF;wBAG7F,IAAI,GAAG,MAAA,uBAAU,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,mCAAI,KAAK,CAAC;wBAErD,sBAAO,IAAI,EAAC;;;;KACZ;IACF,kBAAC;AAAD,CAAC,AApoBD,CAAiC,+BAAc,GAooB9C;AApoBY,kCAAW"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rettiwt-api",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.1.0-alpha.1",
|
|
4
4
|
"main": "dist/index.js",
|
|
5
5
|
"types": "dist/index.d.ts",
|
|
6
6
|
"description": "An API for fetching data from TwitterAPI, without any rate limits!",
|
|
@@ -36,7 +36,7 @@
|
|
|
36
36
|
"commander": "11.1.0",
|
|
37
37
|
"https-proxy-agent": "7.0.2",
|
|
38
38
|
"rettiwt-auth": "2.1.0",
|
|
39
|
-
"rettiwt-core": "4.
|
|
39
|
+
"rettiwt-core": "4.3.0-alpha.0"
|
|
40
40
|
},
|
|
41
41
|
"devDependencies": {
|
|
42
42
|
"@types/node": "20.4.1",
|
|
@@ -21,6 +21,7 @@ import {
|
|
|
21
21
|
IUserHighlightsResponse,
|
|
22
22
|
IUserLikesResponse,
|
|
23
23
|
IUserMediaResponse,
|
|
24
|
+
IUserNotifications as IUserNotificationsResponse,
|
|
24
25
|
IUserRecommendedResponse,
|
|
25
26
|
IUserSubscriptionsResponse,
|
|
26
27
|
IUserTweetsAndRepliesResponse,
|
|
@@ -30,6 +31,7 @@ import {
|
|
|
30
31
|
|
|
31
32
|
import { EBaseType } from '../enums/Data';
|
|
32
33
|
import { CursoredData } from '../models/data/CursoredData';
|
|
34
|
+
import { Notification } from '../models/data/Notification';
|
|
33
35
|
import { Tweet } from '../models/data/Tweet';
|
|
34
36
|
import { User } from '../models/data/User';
|
|
35
37
|
|
|
@@ -82,6 +84,8 @@ export const extractors = {
|
|
|
82
84
|
new CursoredData<Tweet>(response, EBaseType.TWEET),
|
|
83
85
|
USER_MEDIA: (response: IUserMediaResponse): CursoredData<Tweet> =>
|
|
84
86
|
new CursoredData<Tweet>(response, EBaseType.TWEET),
|
|
87
|
+
USER_NOTIFICATIONS: (response: IUserNotificationsResponse): CursoredData<Notification> =>
|
|
88
|
+
new CursoredData<Notification>(response, EBaseType.NOTIFICATION),
|
|
85
89
|
USER_SUBSCRIPTIONS: (response: IUserSubscriptionsResponse): CursoredData<User> =>
|
|
86
90
|
new CursoredData<User>(response, EBaseType.USER),
|
|
87
91
|
USER_TIMELINE: (response: IUserTweetsResponse): CursoredData<Tweet> =>
|
|
@@ -31,6 +31,7 @@ export const fetchResources = [
|
|
|
31
31
|
EResourceType.USER_HIGHLIGHTS,
|
|
32
32
|
EResourceType.USER_LIKES,
|
|
33
33
|
EResourceType.USER_MEDIA,
|
|
34
|
+
EResourceType.USER_NOTIFICATIONS,
|
|
34
35
|
EResourceType.USER_SUBSCRIPTIONS,
|
|
35
36
|
EResourceType.USER_TIMELINE,
|
|
36
37
|
EResourceType.USER_TIMELINE_AND_REPLIES,
|
|
@@ -48,6 +48,7 @@ export const requests: { [key in keyof typeof EResourceType]: (args: FetchArgs |
|
|
|
48
48
|
USER_HIGHLIGHTS: (args: FetchArgs) => request.user.highlights(args.id!, args.count, args.cursor),
|
|
49
49
|
USER_LIKES: (args: FetchArgs) => request.user.likes(args.id!, args.count, args.cursor),
|
|
50
50
|
USER_MEDIA: (args: FetchArgs) => request.user.media(args.id!, args.count, args.cursor),
|
|
51
|
+
USER_NOTIFICATIONS: (args: FetchArgs) => request.user.notifications(args.count, args.cursor),
|
|
51
52
|
USER_SUBSCRIPTIONS: (args: FetchArgs) => request.user.subscriptions(args.id!, args.count, args.cursor),
|
|
52
53
|
USER_TIMELINE: (args: FetchArgs) => request.user.tweets(args.id!, args.count, args.cursor),
|
|
53
54
|
USER_TIMELINE_AND_REPLIES: (args: FetchArgs) => request.user.tweetsAndReplies(args.id!, args.count, args.cursor),
|
package/src/enums/Data.ts
CHANGED
package/src/enums/Resource.ts
CHANGED
|
@@ -37,6 +37,7 @@ export enum EResourceType {
|
|
|
37
37
|
USER_HIGHLIGHTS = 'USER_HIGHLIGHTS',
|
|
38
38
|
USER_LIKES = 'USER_LIKES',
|
|
39
39
|
USER_MEDIA = 'USER_MEDIA',
|
|
40
|
+
USER_NOTIFICATIONS = 'USER_NOTIFICATIONS',
|
|
40
41
|
USER_SUBSCRIPTIONS = 'USER_SUBSCRIPTIONS',
|
|
41
42
|
USER_TIMELINE = 'USER_TIMELINE',
|
|
42
43
|
USER_TIMELINE_AND_REPLIES = 'USER_TIMELINE_AND_REPLIES',
|
package/src/helper/JsonUtils.ts
CHANGED
|
@@ -27,7 +27,7 @@ export function findByFilter<T>(data: NonNullable<unknown>, key: string, value:
|
|
|
27
27
|
res = res.concat(...data.map((item) => findByFilter<T>(item as NonNullable<unknown>, key, value)));
|
|
28
28
|
}
|
|
29
29
|
// If the data is an object
|
|
30
|
-
else if (typeof data == 'object') {
|
|
30
|
+
else if (data != null && typeof data == 'object') {
|
|
31
31
|
/**
|
|
32
32
|
* If the object includes the key and the value specified by the key matches the filter, add it to the result.
|
|
33
33
|
*/
|
|
@@ -60,6 +60,7 @@ export class FetchArgs {
|
|
|
60
60
|
EResourceType.USER_HIGHLIGHTS,
|
|
61
61
|
EResourceType.USER_LIKES,
|
|
62
62
|
EResourceType.USER_MEDIA,
|
|
63
|
+
EResourceType.USER_NOTIFICATIONS,
|
|
63
64
|
EResourceType.USER_SUBSCRIPTIONS,
|
|
64
65
|
EResourceType.USER_TIMELINE,
|
|
65
66
|
EResourceType.USER_TIMELINE_AND_REPLIES,
|
|
@@ -75,6 +76,7 @@ export class FetchArgs {
|
|
|
75
76
|
EResourceType.USER_HIGHLIGHTS,
|
|
76
77
|
EResourceType.USER_LIKES,
|
|
77
78
|
EResourceType.USER_MEDIA,
|
|
79
|
+
EResourceType.USER_NOTIFICATIONS,
|
|
78
80
|
EResourceType.USER_SUBSCRIPTIONS,
|
|
79
81
|
EResourceType.USER_TIMELINE,
|
|
80
82
|
EResourceType.USER_TIMELINE_AND_REPLIES,
|
|
@@ -92,6 +94,9 @@ export class FetchArgs {
|
|
|
92
94
|
EResourceType.USER_SUBSCRIPTIONS,
|
|
93
95
|
],
|
|
94
96
|
})
|
|
97
|
+
@Max(40, {
|
|
98
|
+
groups: [EResourceType.USER_NOTIFICATIONS],
|
|
99
|
+
})
|
|
95
100
|
@Max(20, {
|
|
96
101
|
groups: [EResourceType.TWEET_SEARCH, EResourceType.USER_TIMELINE, EResourceType.USER_TIMELINE_AND_REPLIES],
|
|
97
102
|
})
|
|
@@ -124,6 +129,7 @@ export class FetchArgs {
|
|
|
124
129
|
EResourceType.USER_HIGHLIGHTS,
|
|
125
130
|
EResourceType.USER_LIKES,
|
|
126
131
|
EResourceType.USER_MEDIA,
|
|
132
|
+
EResourceType.USER_NOTIFICATIONS,
|
|
127
133
|
EResourceType.USER_SUBSCRIPTIONS,
|
|
128
134
|
EResourceType.USER_TIMELINE,
|
|
129
135
|
EResourceType.USER_TIMELINE_AND_REPLIES,
|
|
@@ -141,6 +147,7 @@ export class FetchArgs {
|
|
|
141
147
|
EResourceType.USER_HIGHLIGHTS,
|
|
142
148
|
EResourceType.USER_LIKES,
|
|
143
149
|
EResourceType.USER_MEDIA,
|
|
150
|
+
EResourceType.USER_NOTIFICATIONS,
|
|
144
151
|
EResourceType.USER_SUBSCRIPTIONS,
|
|
145
152
|
EResourceType.USER_TIMELINE,
|
|
146
153
|
EResourceType.USER_TIMELINE_AND_REPLIES,
|
|
@@ -169,6 +176,7 @@ export class FetchArgs {
|
|
|
169
176
|
EResourceType.USER_HIGHLIGHTS,
|
|
170
177
|
EResourceType.USER_LIKES,
|
|
171
178
|
EResourceType.USER_MEDIA,
|
|
179
|
+
EResourceType.USER_NOTIFICATIONS,
|
|
172
180
|
EResourceType.USER_SUBSCRIPTIONS,
|
|
173
181
|
EResourceType.USER_TIMELINE,
|
|
174
182
|
EResourceType.USER_TIMELINE_AND_REPLIES,
|
|
@@ -186,7 +194,11 @@ export class FetchArgs {
|
|
|
186
194
|
* - For {@link EResourceType.USER_DETAILS_BY_USERNAME}, can be alphanumeric, while for others, is strictly numeric.
|
|
187
195
|
*/
|
|
188
196
|
@IsEmpty({
|
|
189
|
-
groups: [
|
|
197
|
+
groups: [
|
|
198
|
+
EResourceType.USER_FEED_FOLLOWED,
|
|
199
|
+
EResourceType.USER_FEED_RECOMMENDED,
|
|
200
|
+
EResourceType.USER_NOTIFICATIONS,
|
|
201
|
+
],
|
|
190
202
|
})
|
|
191
203
|
@IsNotEmpty({
|
|
192
204
|
groups: [
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import { ICursor
|
|
1
|
+
import { ICursor } from 'rettiwt-core';
|
|
2
2
|
|
|
3
3
|
import { EBaseType } from '../../enums/Data';
|
|
4
4
|
|
|
5
5
|
import { findByFilter } from '../../helper/JsonUtils';
|
|
6
6
|
|
|
7
|
+
import { Notification } from './Notification';
|
|
7
8
|
import { Tweet } from './Tweet';
|
|
8
9
|
import { User } from './User';
|
|
9
10
|
|
|
@@ -14,25 +15,28 @@ import { User } from './User';
|
|
|
14
15
|
*
|
|
15
16
|
* @public
|
|
16
17
|
*/
|
|
17
|
-
export class CursoredData<T extends Tweet | User> {
|
|
18
|
+
export class CursoredData<T extends Notification | Tweet | User> {
|
|
18
19
|
/** The batch of data of the given type. */
|
|
19
20
|
public list: T[] = [];
|
|
20
21
|
|
|
21
22
|
/** The cursor to the next batch of data. */
|
|
22
|
-
public next: Cursor;
|
|
23
|
+
public next: Cursor = new Cursor('');
|
|
23
24
|
|
|
24
25
|
/**
|
|
25
26
|
* @param response - The raw response.
|
|
26
27
|
* @param type - The base type of the data included in the batch.
|
|
27
28
|
*/
|
|
28
|
-
public constructor(response:
|
|
29
|
+
public constructor(response: NonNullable<unknown>, type: EBaseType) {
|
|
29
30
|
if (type == EBaseType.TWEET) {
|
|
30
31
|
this.list = Tweet.list(response) as T[];
|
|
31
|
-
|
|
32
|
+
this.next = new Cursor(findByFilter<ICursor>(response, 'cursorType', 'Bottom')[0]?.value ?? '');
|
|
33
|
+
} else if (type == EBaseType.USER) {
|
|
32
34
|
this.list = User.list(response) as T[];
|
|
35
|
+
this.next = new Cursor(findByFilter<ICursor>(response, 'cursorType', 'Bottom')[0]?.value ?? '');
|
|
36
|
+
} else if (type == EBaseType.NOTIFICATION) {
|
|
37
|
+
this.list = Notification.list(response) as T[];
|
|
38
|
+
this.next = new Cursor(findByFilter<ICursor>(response, 'cursorType', 'Top')[0]?.value ?? '');
|
|
33
39
|
}
|
|
34
|
-
|
|
35
|
-
this.next = new Cursor(findByFilter<ICursor>(response, 'cursorType', 'Bottom')[0]?.value ?? '');
|
|
36
40
|
}
|
|
37
41
|
}
|
|
38
42
|
|
|
@@ -0,0 +1,91 @@
|
|
|
1
|
+
import {
|
|
2
|
+
ENotificationType as ENotificationTypeOriginal,
|
|
3
|
+
INotification,
|
|
4
|
+
IUserNotifications as IUserNotificationsResponse,
|
|
5
|
+
} from 'rettiwt-core';
|
|
6
|
+
|
|
7
|
+
import { findKeyByValue } from '../../helper/JsonUtils';
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* The different types of notifications.
|
|
11
|
+
*
|
|
12
|
+
* @public
|
|
13
|
+
*/
|
|
14
|
+
export enum ENotificationType {
|
|
15
|
+
RECOMMENDATION = 'RECOMMENDATION',
|
|
16
|
+
INFORMATION = 'INFORMATION',
|
|
17
|
+
LIVE = 'LIVE',
|
|
18
|
+
ALERT = 'ALERT',
|
|
19
|
+
UNDEFINED = 'UNDEFINED',
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/**
|
|
23
|
+
* The details of a single notification.
|
|
24
|
+
*
|
|
25
|
+
* @public
|
|
26
|
+
*/
|
|
27
|
+
export class Notification {
|
|
28
|
+
/** The list of id of the users from whom the notification was received. */
|
|
29
|
+
public from: string[];
|
|
30
|
+
|
|
31
|
+
/** The id of the notification. */
|
|
32
|
+
public id: string;
|
|
33
|
+
|
|
34
|
+
/** The text contents of the notification. */
|
|
35
|
+
public message: string;
|
|
36
|
+
|
|
37
|
+
/** The date/time at which the notification was received. */
|
|
38
|
+
public receivedAt: Date;
|
|
39
|
+
|
|
40
|
+
/** The list of id of the target tweet(s) of the notification. */
|
|
41
|
+
public target: string[];
|
|
42
|
+
|
|
43
|
+
/** The type of notification. */
|
|
44
|
+
public type?: ENotificationType;
|
|
45
|
+
|
|
46
|
+
/**
|
|
47
|
+
* @param notification - The raw notification details.
|
|
48
|
+
*/
|
|
49
|
+
public constructor(notification: INotification) {
|
|
50
|
+
// Getting the original notification type
|
|
51
|
+
const notificationType: string | undefined = findKeyByValue(ENotificationTypeOriginal, notification.icon.id);
|
|
52
|
+
|
|
53
|
+
this.from = notification.template?.aggregateUserActionsV1?.fromUsers
|
|
54
|
+
? notification.template.aggregateUserActionsV1.fromUsers.map((item) => item.user.id)
|
|
55
|
+
: [];
|
|
56
|
+
this.id = notification.id;
|
|
57
|
+
this.message = notification.message.text;
|
|
58
|
+
this.receivedAt = new Date(Number(notification.timestampMs));
|
|
59
|
+
this.target = notification.template?.aggregateUserActionsV1?.targetObjects
|
|
60
|
+
? notification.template.aggregateUserActionsV1.targetObjects.map((item) => item.tweet.id)
|
|
61
|
+
: [];
|
|
62
|
+
this.type = notificationType
|
|
63
|
+
? ENotificationType[notificationType as keyof typeof ENotificationType]
|
|
64
|
+
: ENotificationType.UNDEFINED;
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Extracts and deserializes the list of notifications from the given raw response data.
|
|
69
|
+
*
|
|
70
|
+
* @param response - The raw response data.
|
|
71
|
+
*
|
|
72
|
+
* @returns The deserialized list of notifications.
|
|
73
|
+
*
|
|
74
|
+
* @internal
|
|
75
|
+
*/
|
|
76
|
+
public static list(response: NonNullable<unknown>): Notification[] {
|
|
77
|
+
const notifications: Notification[] = [];
|
|
78
|
+
|
|
79
|
+
// Extracting notifications
|
|
80
|
+
if ((response as IUserNotificationsResponse).globalObjects.notifications) {
|
|
81
|
+
// Iterating over the raw list of notifications
|
|
82
|
+
for (const [, value] of Object.entries(
|
|
83
|
+
(response as IUserNotificationsResponse).globalObjects.notifications,
|
|
84
|
+
)) {
|
|
85
|
+
notifications.push(new Notification(value as INotification));
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
return notifications;
|
|
90
|
+
}
|
|
91
|
+
}
|
package/src/models/data/Tweet.ts
CHANGED
|
@@ -3,7 +3,6 @@ import {
|
|
|
3
3
|
IExtendedMedia as IRawExtendedMedia,
|
|
4
4
|
ITweet as IRawTweet,
|
|
5
5
|
IEntities as IRawTweetEntities,
|
|
6
|
-
IResponse,
|
|
7
6
|
ITimelineTweet,
|
|
8
7
|
ITweet,
|
|
9
8
|
} from 'rettiwt-core';
|
|
@@ -102,7 +101,7 @@ export class Tweet {
|
|
|
102
101
|
*
|
|
103
102
|
* @internal
|
|
104
103
|
*/
|
|
105
|
-
public static list(response:
|
|
104
|
+
public static list(response: NonNullable<unknown>): Tweet[] {
|
|
106
105
|
const tweets: Tweet[] = [];
|
|
107
106
|
|
|
108
107
|
// Extracting the matching data
|
|
@@ -137,7 +136,7 @@ export class Tweet {
|
|
|
137
136
|
*
|
|
138
137
|
* @internal
|
|
139
138
|
*/
|
|
140
|
-
public static single(response:
|
|
139
|
+
public static single(response: NonNullable<unknown>, id: string): Tweet | undefined {
|
|
141
140
|
const tweets: Tweet[] = [];
|
|
142
141
|
|
|
143
142
|
// Extracting the matching data
|
package/src/models/data/User.ts
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { IUser as IRawUser,
|
|
1
|
+
import { IUser as IRawUser, ITimelineUser, IUser } from 'rettiwt-core';
|
|
2
2
|
|
|
3
3
|
import { ELogActions } from '../../enums/Logging';
|
|
4
4
|
import { findByFilter } from '../../helper/JsonUtils';
|
|
@@ -81,7 +81,7 @@ export class User {
|
|
|
81
81
|
*
|
|
82
82
|
* @internal
|
|
83
83
|
*/
|
|
84
|
-
public static list(response:
|
|
84
|
+
public static list(response: NonNullable<unknown>): User[] {
|
|
85
85
|
const users: User[] = [];
|
|
86
86
|
|
|
87
87
|
// Extracting the matching data
|
|
@@ -115,7 +115,7 @@ export class User {
|
|
|
115
115
|
*
|
|
116
116
|
* @internal
|
|
117
117
|
*/
|
|
118
|
-
public static single(response:
|
|
118
|
+
public static single(response: NonNullable<unknown>): User | undefined {
|
|
119
119
|
const users: User[] = [];
|
|
120
120
|
|
|
121
121
|
// Extracting the matching data
|
|
@@ -454,9 +454,10 @@ export class TweetService extends FetcherService {
|
|
|
454
454
|
* // Creating a new Rettiwt instance using the given 'API_KEY'
|
|
455
455
|
* const rettiwt = new Rettiwt({ apiKey: API_KEY });
|
|
456
456
|
*
|
|
457
|
-
* //
|
|
458
|
-
*
|
|
457
|
+
* // Creating a function that streams all new tweets from the user 'user1'
|
|
458
|
+
* async function streamTweets() {
|
|
459
459
|
* try {
|
|
460
|
+
* // Awaiting for the tweets returned by the AsyncGenerator returned by the method
|
|
460
461
|
* for await (const tweet of rettiwt.tweet.stream({ fromUsers: ['user1'] }, 1000)) {
|
|
461
462
|
* console.log(tweet.fullText);
|
|
462
463
|
* }
|
|
@@ -464,7 +465,10 @@ export class TweetService extends FetcherService {
|
|
|
464
465
|
* catch (err) {
|
|
465
466
|
* console.log(err);
|
|
466
467
|
* }
|
|
467
|
-
* }
|
|
468
|
+
* }
|
|
469
|
+
*
|
|
470
|
+
* // Calling the function
|
|
471
|
+
* streamTweets();
|
|
468
472
|
* ```
|
|
469
473
|
*/
|
|
470
474
|
public async *stream(filter: TweetFilter, pollingInterval: number = 60000): AsyncGenerator<Tweet> {
|