rettiwt-api 6.1.1 → 6.1.2
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/dist/models/data/Notification.js +12 -14
- package/dist/models/data/Notification.js.map +1 -1
- package/dist/types/raw/base/Notification.d.ts +35 -33
- package/dist/types/raw/user/Notifications.d.ts +379 -93
- package/package.json +1 -1
- package/src/models/data/Notification.ts +14 -18
- package/src/types/raw/base/Notification.ts +35 -36
- package/src/types/raw/user/Notifications.ts +412 -88
|
@@ -2,7 +2,6 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.Notification = void 0;
|
|
4
4
|
const Notification_1 = require("../../enums/Notification");
|
|
5
|
-
const Notification_2 = require("../../enums/raw/Notification");
|
|
6
5
|
const JsonUtils_1 = require("../../helper/JsonUtils");
|
|
7
6
|
/**
|
|
8
7
|
* The details of a single notification.
|
|
@@ -24,15 +23,15 @@ class Notification {
|
|
|
24
23
|
constructor(notification) {
|
|
25
24
|
this._raw = { ...notification };
|
|
26
25
|
// Getting the original notification type
|
|
27
|
-
const notificationType =
|
|
28
|
-
this.from = notification.template
|
|
29
|
-
? notification.template.
|
|
26
|
+
const notificationType = notification.notification_icon.toString();
|
|
27
|
+
this.from = notification.template.from_users
|
|
28
|
+
? notification.template.from_users.map((item) => item.user_results.result.rest_id)
|
|
30
29
|
: [];
|
|
31
30
|
this.id = notification.id;
|
|
32
|
-
this.message = notification.
|
|
33
|
-
this.receivedAt = new Date(
|
|
34
|
-
this.target = notification.template
|
|
35
|
-
? notification.template.
|
|
31
|
+
this.message = notification.rich_message.text;
|
|
32
|
+
this.receivedAt = new Date(notification.timestamp_ms).toISOString();
|
|
33
|
+
this.target = notification.template.target_objects
|
|
34
|
+
? notification.template.target_objects.map((item) => item.tweet_results.result.rest_id)
|
|
36
35
|
: [];
|
|
37
36
|
this.type = notificationType
|
|
38
37
|
? Notification_1.NotificationType[notificationType]
|
|
@@ -51,12 +50,11 @@ class Notification {
|
|
|
51
50
|
*/
|
|
52
51
|
static list(response) {
|
|
53
52
|
const notifications = [];
|
|
54
|
-
// Extracting
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
}
|
|
53
|
+
// Extracting the matching data
|
|
54
|
+
const extract = (0, JsonUtils_1.findByFilter)(response, '__typename', 'TimelineNotification');
|
|
55
|
+
// Deserializing valid data
|
|
56
|
+
for (const item of extract) {
|
|
57
|
+
notifications.push(new Notification(item));
|
|
60
58
|
}
|
|
61
59
|
return notifications;
|
|
62
60
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Notification.js","sourceRoot":"","sources":["../../../src/models/data/Notification.ts"],"names":[],"mappings":";;;AAAA,2DAA4D;AAC5D
|
|
1
|
+
{"version":3,"file":"Notification.js","sourceRoot":"","sources":["../../../src/models/data/Notification.ts"],"names":[],"mappings":";;;AAAA,2DAA4D;AAC5D,sDAAsD;AAItD;;;;GAIG;AACH,MAAa,YAAY;IACxB,oCAAoC;IACnB,IAAI,CAAmB;IAEjC,IAAI,CAAW;IACf,EAAE,CAAS;IACX,OAAO,CAAS;IAChB,UAAU,CAAS;IACnB,MAAM,CAAW;IACjB,IAAI,CAAoB;IAE/B;;OAEG;IACH,YAAmB,YAA8B;QAChD,IAAI,CAAC,IAAI,GAAG,EAAE,GAAG,YAAY,EAAE,CAAC;QAEhC,yCAAyC;QACzC,MAAM,gBAAgB,GAAG,YAAY,CAAC,iBAAiB,CAAC,QAAQ,EAAE,CAAC;QAEnE,IAAI,CAAC,IAAI,GAAG,YAAY,CAAC,QAAQ,CAAC,UAAU;YAC3C,CAAC,CAAC,YAAY,CAAC,QAAQ,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC;YAClF,CAAC,CAAC,EAAE,CAAC;QACN,IAAI,CAAC,EAAE,GAAG,YAAY,CAAC,EAAE,CAAC;QAC1B,IAAI,CAAC,OAAO,GAAG,YAAY,CAAC,YAAY,CAAC,IAAI,CAAC;QAC9C,IAAI,CAAC,UAAU,GAAG,IAAI,IAAI,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC,WAAW,EAAE,CAAC;QACpE,IAAI,CAAC,MAAM,GAAG,YAAY,CAAC,QAAQ,CAAC,cAAc;YACjD,CAAC,CAAC,YAAY,CAAC,QAAQ,CAAC,cAAc,CAAC,GAAG,CAAC,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,CAAC,aAAa,CAAC,MAAM,CAAC,OAAO,CAAC;YACvF,CAAC,CAAC,EAAE,CAAC;QACN,IAAI,CAAC,IAAI,GAAG,gBAAgB;YAC3B,CAAC,CAAC,+BAAgB,CAAC,gBAAiD,CAAC;YACrE,CAAC,CAAC,+BAAgB,CAAC,SAAS,CAAC;IAC/B,CAAC;IAED,oCAAoC;IACpC,IAAW,GAAG;QACb,OAAO,EAAE,GAAG,IAAI,CAAC,IAAI,EAAE,CAAC;IACzB,CAAC;IAED;;;;;;OAMG;IACI,MAAM,CAAC,IAAI,CAAC,QAA8B;QAChD,MAAM,aAAa,GAAmB,EAAE,CAAC;QAEzC,+BAA+B;QAC/B,MAAM,OAAO,GAAG,IAAA,wBAAY,EAAmB,QAAQ,EAAE,YAAY,EAAE,sBAAsB,CAAC,CAAC;QAE/F,2BAA2B;QAC3B,KAAK,MAAM,IAAI,IAAI,OAAO,EAAE,CAAC;YAC5B,aAAa,CAAC,IAAI,CAAC,IAAI,YAAY,CAAC,IAAI,CAAC,CAAC,CAAC;QAC5C,CAAC;QAED,OAAO,aAAa,CAAC;IACtB,CAAC;IAED;;OAEG;IACI,MAAM;QACZ,OAAO;YACN,IAAI,EAAE,IAAI,CAAC,IAAI;YACf,EAAE,EAAE,IAAI,CAAC,EAAE;YACX,OAAO,EAAE,IAAI,CAAC,OAAO;YACrB,UAAU,EAAE,IAAI,CAAC,UAAU;YAC3B,MAAM,EAAE,IAAI,CAAC,MAAM;YACnB,IAAI,EAAE,IAAI,CAAC,IAAI;SACf,CAAC;IACH,CAAC;CACD;AAzED,oCAyEC"}
|
|
@@ -1,53 +1,55 @@
|
|
|
1
1
|
import { RawNotificationType } from '../../../enums/raw/Notification';
|
|
2
|
+
import { IDataResult } from '../composite/DataResult';
|
|
3
|
+
import { ITweet } from './Tweet';
|
|
4
|
+
import { IUser } from './User';
|
|
2
5
|
/**
|
|
3
6
|
* Represents the raw data of a single Notification.
|
|
4
7
|
*
|
|
5
8
|
* @public
|
|
6
9
|
*/
|
|
7
10
|
export interface INotification {
|
|
11
|
+
itemType: string;
|
|
12
|
+
__typename: string;
|
|
8
13
|
id: string;
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
template:
|
|
14
|
+
notification_icon: RawNotificationType;
|
|
15
|
+
rich_message: INotificationRichMessage;
|
|
16
|
+
notification_url: INotificationUrl;
|
|
17
|
+
template: INoticiationTemplate;
|
|
18
|
+
timestamp_ms: string;
|
|
13
19
|
}
|
|
14
|
-
export interface
|
|
15
|
-
id: RawNotificationType;
|
|
16
|
-
}
|
|
17
|
-
export interface INotificationMessage {
|
|
18
|
-
text: string;
|
|
19
|
-
entities: INotificationMessageEntity[];
|
|
20
|
+
export interface INotificationRichMessage {
|
|
20
21
|
rtl: boolean;
|
|
22
|
+
text: string;
|
|
23
|
+
entities: INotificationEntity[];
|
|
21
24
|
}
|
|
22
|
-
export interface
|
|
25
|
+
export interface INotificationEntity {
|
|
23
26
|
fromIndex: number;
|
|
24
27
|
toIndex: number;
|
|
25
|
-
|
|
28
|
+
ref: INotificationEntityRef;
|
|
26
29
|
}
|
|
27
|
-
export interface
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
export interface INotificationUserActions {
|
|
31
|
-
targetObjects: INotificationTargetObject[];
|
|
32
|
-
fromUsers: INotificationFromUser[];
|
|
33
|
-
additionalContext: INotificationAdditionalContext;
|
|
34
|
-
}
|
|
35
|
-
export interface INotificationTargetObject {
|
|
36
|
-
tweet: INotificationTweet;
|
|
30
|
+
export interface INotificationEntityRef {
|
|
31
|
+
type: string;
|
|
32
|
+
user_results: IDataResult<IUser>;
|
|
37
33
|
}
|
|
38
|
-
export interface
|
|
39
|
-
|
|
34
|
+
export interface INotificationUrl {
|
|
35
|
+
url: string;
|
|
36
|
+
urlType: string;
|
|
37
|
+
urtEndpointOptions?: INotificationUrtEndpointOptions;
|
|
40
38
|
}
|
|
41
|
-
export interface
|
|
42
|
-
|
|
39
|
+
export interface INotificationUrtEndpointOptions {
|
|
40
|
+
cacheId: string;
|
|
41
|
+
title: string;
|
|
43
42
|
}
|
|
44
|
-
export interface
|
|
45
|
-
|
|
43
|
+
export interface INoticiationTemplate {
|
|
44
|
+
__typename: string;
|
|
45
|
+
target_objects: INotificationTargetObject[];
|
|
46
|
+
from_users: INotificationFromUser[];
|
|
46
47
|
}
|
|
47
|
-
export interface
|
|
48
|
-
|
|
48
|
+
export interface INotificationTargetObject {
|
|
49
|
+
__typename: string;
|
|
50
|
+
tweet_results: IDataResult<ITweet>;
|
|
49
51
|
}
|
|
50
|
-
export interface
|
|
51
|
-
|
|
52
|
-
|
|
52
|
+
export interface INotificationFromUser {
|
|
53
|
+
__typename: string;
|
|
54
|
+
user_results: IDataResult<IUser>;
|
|
53
55
|
}
|
|
@@ -4,76 +4,33 @@
|
|
|
4
4
|
* @public
|
|
5
5
|
*/
|
|
6
6
|
export interface IUserNotificationsResponse {
|
|
7
|
-
|
|
8
|
-
timeline: Timeline;
|
|
9
|
-
}
|
|
10
|
-
interface GlobalObjects {
|
|
11
|
-
notifications: Notifications;
|
|
7
|
+
data: Data;
|
|
12
8
|
}
|
|
13
|
-
interface
|
|
14
|
-
|
|
15
|
-
}
|
|
16
|
-
interface Notification {
|
|
17
|
-
id: string;
|
|
18
|
-
timestampMs: string;
|
|
19
|
-
icon: Icon;
|
|
20
|
-
message: Message;
|
|
21
|
-
template: Template;
|
|
9
|
+
interface Data {
|
|
10
|
+
viewer_v2: ViewerV2;
|
|
22
11
|
}
|
|
23
|
-
interface
|
|
24
|
-
|
|
12
|
+
interface ViewerV2 {
|
|
13
|
+
user_results: UserResults;
|
|
25
14
|
}
|
|
26
|
-
interface
|
|
27
|
-
|
|
28
|
-
entities: Entity[];
|
|
29
|
-
rtl: boolean;
|
|
30
|
-
}
|
|
31
|
-
interface Entity {
|
|
32
|
-
fromIndex: number;
|
|
33
|
-
toIndex: number;
|
|
34
|
-
format: string;
|
|
35
|
-
}
|
|
36
|
-
interface Template {
|
|
37
|
-
aggregateUserActionsV1: AggregateUserActionsV1;
|
|
15
|
+
interface UserResults {
|
|
16
|
+
result: Result;
|
|
38
17
|
}
|
|
39
|
-
interface
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
18
|
+
interface Result {
|
|
19
|
+
__typename: string;
|
|
20
|
+
rest_id: string;
|
|
21
|
+
notification_timeline: NotificationTimeline;
|
|
43
22
|
}
|
|
44
|
-
interface
|
|
45
|
-
tweet: Tweet;
|
|
46
|
-
}
|
|
47
|
-
interface Tweet {
|
|
23
|
+
interface NotificationTimeline {
|
|
48
24
|
id: string;
|
|
49
|
-
|
|
50
|
-
interface FromUser {
|
|
51
|
-
user: User;
|
|
52
|
-
}
|
|
53
|
-
interface User {
|
|
54
|
-
id: string;
|
|
55
|
-
}
|
|
56
|
-
interface AdditionalContext {
|
|
57
|
-
contextText: ContextText;
|
|
58
|
-
}
|
|
59
|
-
interface ContextText {
|
|
60
|
-
text: string;
|
|
61
|
-
entities: any[];
|
|
25
|
+
timeline: Timeline;
|
|
62
26
|
}
|
|
63
27
|
interface Timeline {
|
|
64
|
-
id: string;
|
|
65
28
|
instructions: Instruction[];
|
|
66
29
|
}
|
|
67
30
|
interface Instruction {
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
markEntriesUnreadGreaterThanSortIndex?: MarkEntriesUnreadGreaterThanSortIndex;
|
|
72
|
-
}
|
|
73
|
-
interface ClearCache {
|
|
74
|
-
}
|
|
75
|
-
interface AddEntries {
|
|
76
|
-
entries: Entry[];
|
|
31
|
+
type: string;
|
|
32
|
+
entries?: Entry[];
|
|
33
|
+
sort_index?: string;
|
|
77
34
|
}
|
|
78
35
|
interface Entry {
|
|
79
36
|
entryId: string;
|
|
@@ -81,38 +38,380 @@ interface Entry {
|
|
|
81
38
|
content: Content;
|
|
82
39
|
}
|
|
83
40
|
interface Content {
|
|
84
|
-
|
|
85
|
-
|
|
41
|
+
entryType: string;
|
|
42
|
+
__typename: string;
|
|
43
|
+
value?: string;
|
|
44
|
+
cursorType?: string;
|
|
45
|
+
itemContent?: ItemContent;
|
|
46
|
+
clientEventInfo?: ClientEventInfo;
|
|
47
|
+
}
|
|
48
|
+
interface ItemContent {
|
|
49
|
+
itemType: string;
|
|
50
|
+
__typename: string;
|
|
51
|
+
id: string;
|
|
52
|
+
notification_icon: string;
|
|
53
|
+
rich_message: RichMessage;
|
|
54
|
+
notification_url: NotificationUrl;
|
|
55
|
+
template: Template;
|
|
56
|
+
timestamp_ms: string;
|
|
86
57
|
}
|
|
87
|
-
interface
|
|
88
|
-
|
|
58
|
+
interface RichMessage {
|
|
59
|
+
rtl: boolean;
|
|
60
|
+
text: string;
|
|
61
|
+
entities: Entity[];
|
|
89
62
|
}
|
|
90
|
-
interface
|
|
91
|
-
|
|
92
|
-
|
|
63
|
+
interface Entity {
|
|
64
|
+
fromIndex: number;
|
|
65
|
+
toIndex: number;
|
|
66
|
+
ref: Ref;
|
|
93
67
|
}
|
|
94
|
-
interface
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
feedbackInfo?: FeedbackInfo;
|
|
68
|
+
interface Ref {
|
|
69
|
+
type: string;
|
|
70
|
+
user_results: UserResults2;
|
|
98
71
|
}
|
|
99
|
-
interface
|
|
100
|
-
|
|
72
|
+
interface UserResults2 {
|
|
73
|
+
result: Result2;
|
|
101
74
|
}
|
|
102
|
-
interface
|
|
75
|
+
interface Result2 {
|
|
76
|
+
__typename: string;
|
|
103
77
|
id: string;
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
78
|
+
rest_id: string;
|
|
79
|
+
affiliates_highlighted_label: AffiliatesHighlightedLabel;
|
|
80
|
+
avatar: Avatar;
|
|
81
|
+
core: Core;
|
|
82
|
+
dm_permissions: DmPermissions;
|
|
83
|
+
follow_request_sent: boolean;
|
|
84
|
+
has_graduated_access: boolean;
|
|
85
|
+
is_blue_verified: boolean;
|
|
86
|
+
legacy: Legacy;
|
|
87
|
+
location: Location;
|
|
88
|
+
media_permissions: MediaPermissions;
|
|
89
|
+
parody_commentary_fan_label: string;
|
|
90
|
+
profile_image_shape: string;
|
|
91
|
+
profile_bio: ProfileBio;
|
|
92
|
+
privacy: Privacy;
|
|
93
|
+
relationship_perspectives: RelationshipPerspectives;
|
|
94
|
+
tipjar_settings: TipjarSettings;
|
|
95
|
+
verification: Verification;
|
|
96
|
+
verified_phone_status: boolean;
|
|
97
|
+
}
|
|
98
|
+
interface AffiliatesHighlightedLabel {
|
|
99
|
+
}
|
|
100
|
+
interface Avatar {
|
|
101
|
+
image_url: string;
|
|
102
|
+
}
|
|
103
|
+
interface Core {
|
|
104
|
+
created_at: string;
|
|
105
|
+
name: string;
|
|
106
|
+
screen_name: string;
|
|
107
|
+
}
|
|
108
|
+
interface DmPermissions {
|
|
109
|
+
can_dm: boolean;
|
|
110
|
+
}
|
|
111
|
+
interface Legacy {
|
|
112
|
+
default_profile: boolean;
|
|
113
|
+
default_profile_image: boolean;
|
|
114
|
+
description: string;
|
|
115
|
+
entities: Entities;
|
|
116
|
+
fast_followers_count: number;
|
|
117
|
+
favourites_count: number;
|
|
118
|
+
followers_count: number;
|
|
119
|
+
friends_count: number;
|
|
120
|
+
has_custom_timelines: boolean;
|
|
121
|
+
is_translator: boolean;
|
|
122
|
+
listed_count: number;
|
|
123
|
+
media_count: number;
|
|
124
|
+
normal_followers_count: number;
|
|
125
|
+
notifications: boolean;
|
|
126
|
+
pinned_tweet_ids_str: any[];
|
|
127
|
+
possibly_sensitive: boolean;
|
|
128
|
+
profile_interstitial_type: string;
|
|
129
|
+
statuses_count: number;
|
|
130
|
+
translator_type: string;
|
|
131
|
+
want_retweets: boolean;
|
|
132
|
+
withheld_in_countries: any[];
|
|
133
|
+
}
|
|
134
|
+
interface Entities {
|
|
135
|
+
description: Description;
|
|
136
|
+
}
|
|
137
|
+
interface Description {
|
|
138
|
+
urls: any[];
|
|
139
|
+
}
|
|
140
|
+
interface Location {
|
|
141
|
+
location: string;
|
|
142
|
+
}
|
|
143
|
+
interface MediaPermissions {
|
|
144
|
+
can_media_tag: boolean;
|
|
145
|
+
}
|
|
146
|
+
interface ProfileBio {
|
|
147
|
+
description: string;
|
|
148
|
+
}
|
|
149
|
+
interface Privacy {
|
|
150
|
+
protected: boolean;
|
|
151
|
+
}
|
|
152
|
+
interface RelationshipPerspectives {
|
|
153
|
+
followed_by: boolean;
|
|
154
|
+
following: boolean;
|
|
155
|
+
}
|
|
156
|
+
interface TipjarSettings {
|
|
157
|
+
}
|
|
158
|
+
interface Verification {
|
|
159
|
+
verified: boolean;
|
|
160
|
+
}
|
|
161
|
+
interface NotificationUrl {
|
|
110
162
|
url: string;
|
|
163
|
+
urlType: string;
|
|
111
164
|
urtEndpointOptions?: UrtEndpointOptions;
|
|
112
165
|
}
|
|
113
166
|
interface UrtEndpointOptions {
|
|
114
|
-
title: string;
|
|
115
167
|
cacheId: string;
|
|
168
|
+
title: string;
|
|
169
|
+
}
|
|
170
|
+
interface Template {
|
|
171
|
+
__typename: string;
|
|
172
|
+
target_objects: TargetObject[];
|
|
173
|
+
from_users: FromUser[];
|
|
174
|
+
}
|
|
175
|
+
interface TargetObject {
|
|
176
|
+
__typename: string;
|
|
177
|
+
tweet_results: TweetResults;
|
|
178
|
+
}
|
|
179
|
+
interface TweetResults {
|
|
180
|
+
result: Result3;
|
|
181
|
+
}
|
|
182
|
+
interface Result3 {
|
|
183
|
+
__typename: string;
|
|
184
|
+
rest_id: string;
|
|
185
|
+
core: Core2;
|
|
186
|
+
unmention_data: UnmentionData;
|
|
187
|
+
edit_control: EditControl;
|
|
188
|
+
is_translatable: boolean;
|
|
189
|
+
views: Views;
|
|
190
|
+
source: string;
|
|
191
|
+
grok_analysis_button: boolean;
|
|
192
|
+
legacy: Legacy3;
|
|
193
|
+
}
|
|
194
|
+
interface Core2 {
|
|
195
|
+
user_results: UserResults3;
|
|
196
|
+
}
|
|
197
|
+
interface UserResults3 {
|
|
198
|
+
result: Result4;
|
|
199
|
+
}
|
|
200
|
+
interface Result4 {
|
|
201
|
+
__typename: string;
|
|
202
|
+
id: string;
|
|
203
|
+
rest_id: string;
|
|
204
|
+
affiliates_highlighted_label: AffiliatesHighlightedLabel2;
|
|
205
|
+
avatar: Avatar2;
|
|
206
|
+
core: Core3;
|
|
207
|
+
dm_permissions: DmPermissions2;
|
|
208
|
+
follow_request_sent: boolean;
|
|
209
|
+
has_graduated_access: boolean;
|
|
210
|
+
is_blue_verified: boolean;
|
|
211
|
+
legacy: Legacy2;
|
|
212
|
+
location: Location2;
|
|
213
|
+
media_permissions: MediaPermissions2;
|
|
214
|
+
parody_commentary_fan_label: string;
|
|
215
|
+
profile_image_shape: string;
|
|
216
|
+
profile_bio: ProfileBio2;
|
|
217
|
+
privacy: Privacy2;
|
|
218
|
+
relationship_perspectives: RelationshipPerspectives2;
|
|
219
|
+
tipjar_settings: TipjarSettings2;
|
|
220
|
+
verification: Verification2;
|
|
221
|
+
verified_phone_status: boolean;
|
|
222
|
+
}
|
|
223
|
+
interface AffiliatesHighlightedLabel2 {
|
|
224
|
+
}
|
|
225
|
+
interface Avatar2 {
|
|
226
|
+
image_url: string;
|
|
227
|
+
}
|
|
228
|
+
interface Core3 {
|
|
229
|
+
created_at: string;
|
|
230
|
+
name: string;
|
|
231
|
+
screen_name: string;
|
|
232
|
+
}
|
|
233
|
+
interface DmPermissions2 {
|
|
234
|
+
can_dm: boolean;
|
|
235
|
+
}
|
|
236
|
+
interface Legacy2 {
|
|
237
|
+
default_profile: boolean;
|
|
238
|
+
default_profile_image: boolean;
|
|
239
|
+
description: string;
|
|
240
|
+
entities: Entities2;
|
|
241
|
+
fast_followers_count: number;
|
|
242
|
+
favourites_count: number;
|
|
243
|
+
followers_count: number;
|
|
244
|
+
friends_count: number;
|
|
245
|
+
has_custom_timelines: boolean;
|
|
246
|
+
is_translator: boolean;
|
|
247
|
+
listed_count: number;
|
|
248
|
+
media_count: number;
|
|
249
|
+
needs_phone_verification: boolean;
|
|
250
|
+
normal_followers_count: number;
|
|
251
|
+
pinned_tweet_ids_str: any[];
|
|
252
|
+
possibly_sensitive: boolean;
|
|
253
|
+
profile_interstitial_type: string;
|
|
254
|
+
statuses_count: number;
|
|
255
|
+
translator_type: string;
|
|
256
|
+
want_retweets: boolean;
|
|
257
|
+
withheld_in_countries: any[];
|
|
258
|
+
}
|
|
259
|
+
interface Entities2 {
|
|
260
|
+
description: Description2;
|
|
261
|
+
}
|
|
262
|
+
interface Description2 {
|
|
263
|
+
urls: any[];
|
|
264
|
+
}
|
|
265
|
+
interface Location2 {
|
|
266
|
+
location: string;
|
|
267
|
+
}
|
|
268
|
+
interface MediaPermissions2 {
|
|
269
|
+
can_media_tag: boolean;
|
|
270
|
+
}
|
|
271
|
+
interface ProfileBio2 {
|
|
272
|
+
description: string;
|
|
273
|
+
}
|
|
274
|
+
interface Privacy2 {
|
|
275
|
+
protected: boolean;
|
|
276
|
+
}
|
|
277
|
+
interface RelationshipPerspectives2 {
|
|
278
|
+
following: boolean;
|
|
279
|
+
}
|
|
280
|
+
interface TipjarSettings2 {
|
|
281
|
+
}
|
|
282
|
+
interface Verification2 {
|
|
283
|
+
verified: boolean;
|
|
284
|
+
}
|
|
285
|
+
interface UnmentionData {
|
|
286
|
+
}
|
|
287
|
+
interface EditControl {
|
|
288
|
+
edit_tweet_ids: string[];
|
|
289
|
+
editable_until_msecs: string;
|
|
290
|
+
is_edit_eligible: boolean;
|
|
291
|
+
edits_remaining: string;
|
|
292
|
+
}
|
|
293
|
+
interface Views {
|
|
294
|
+
count: string;
|
|
295
|
+
state: string;
|
|
296
|
+
}
|
|
297
|
+
interface Legacy3 {
|
|
298
|
+
bookmark_count: number;
|
|
299
|
+
bookmarked: boolean;
|
|
300
|
+
created_at: string;
|
|
301
|
+
conversation_id_str: string;
|
|
302
|
+
display_text_range: number[];
|
|
303
|
+
entities: Entities3;
|
|
304
|
+
favorite_count: number;
|
|
305
|
+
favorited: boolean;
|
|
306
|
+
full_text: string;
|
|
307
|
+
is_quote_status: boolean;
|
|
308
|
+
lang: string;
|
|
309
|
+
quote_count: number;
|
|
310
|
+
reply_count: number;
|
|
311
|
+
retweet_count: number;
|
|
312
|
+
retweeted: boolean;
|
|
313
|
+
user_id_str: string;
|
|
314
|
+
id_str: string;
|
|
315
|
+
}
|
|
316
|
+
interface Entities3 {
|
|
317
|
+
hashtags: any[];
|
|
318
|
+
symbols: any[];
|
|
319
|
+
timestamps: any[];
|
|
320
|
+
urls: any[];
|
|
321
|
+
user_mentions: any[];
|
|
322
|
+
}
|
|
323
|
+
interface FromUser {
|
|
324
|
+
__typename: string;
|
|
325
|
+
user_results: UserResults4;
|
|
326
|
+
}
|
|
327
|
+
interface UserResults4 {
|
|
328
|
+
result: Result5;
|
|
329
|
+
}
|
|
330
|
+
interface Result5 {
|
|
331
|
+
__typename: string;
|
|
332
|
+
id: string;
|
|
333
|
+
rest_id: string;
|
|
334
|
+
affiliates_highlighted_label: AffiliatesHighlightedLabel3;
|
|
335
|
+
avatar: Avatar3;
|
|
336
|
+
core: Core4;
|
|
337
|
+
dm_permissions: DmPermissions3;
|
|
338
|
+
follow_request_sent: boolean;
|
|
339
|
+
has_graduated_access: boolean;
|
|
340
|
+
is_blue_verified: boolean;
|
|
341
|
+
legacy: Legacy4;
|
|
342
|
+
location: Location3;
|
|
343
|
+
media_permissions: MediaPermissions3;
|
|
344
|
+
parody_commentary_fan_label: string;
|
|
345
|
+
profile_image_shape: string;
|
|
346
|
+
profile_bio: ProfileBio3;
|
|
347
|
+
privacy: Privacy3;
|
|
348
|
+
relationship_perspectives: RelationshipPerspectives3;
|
|
349
|
+
tipjar_settings: TipjarSettings3;
|
|
350
|
+
verification: Verification3;
|
|
351
|
+
verified_phone_status: boolean;
|
|
352
|
+
}
|
|
353
|
+
interface AffiliatesHighlightedLabel3 {
|
|
354
|
+
}
|
|
355
|
+
interface Avatar3 {
|
|
356
|
+
image_url: string;
|
|
357
|
+
}
|
|
358
|
+
interface Core4 {
|
|
359
|
+
created_at: string;
|
|
360
|
+
name: string;
|
|
361
|
+
screen_name: string;
|
|
362
|
+
}
|
|
363
|
+
interface DmPermissions3 {
|
|
364
|
+
can_dm: boolean;
|
|
365
|
+
}
|
|
366
|
+
interface Legacy4 {
|
|
367
|
+
default_profile: boolean;
|
|
368
|
+
default_profile_image: boolean;
|
|
369
|
+
description: string;
|
|
370
|
+
entities: Entities4;
|
|
371
|
+
fast_followers_count: number;
|
|
372
|
+
favourites_count: number;
|
|
373
|
+
followers_count: number;
|
|
374
|
+
friends_count: number;
|
|
375
|
+
has_custom_timelines: boolean;
|
|
376
|
+
is_translator: boolean;
|
|
377
|
+
listed_count: number;
|
|
378
|
+
media_count: number;
|
|
379
|
+
normal_followers_count: number;
|
|
380
|
+
notifications: boolean;
|
|
381
|
+
pinned_tweet_ids_str: any[];
|
|
382
|
+
possibly_sensitive: boolean;
|
|
383
|
+
profile_interstitial_type: string;
|
|
384
|
+
statuses_count: number;
|
|
385
|
+
translator_type: string;
|
|
386
|
+
want_retweets: boolean;
|
|
387
|
+
withheld_in_countries: any[];
|
|
388
|
+
}
|
|
389
|
+
interface Entities4 {
|
|
390
|
+
description: Description3;
|
|
391
|
+
}
|
|
392
|
+
interface Description3 {
|
|
393
|
+
urls: any[];
|
|
394
|
+
}
|
|
395
|
+
interface Location3 {
|
|
396
|
+
location: string;
|
|
397
|
+
}
|
|
398
|
+
interface MediaPermissions3 {
|
|
399
|
+
can_media_tag: boolean;
|
|
400
|
+
}
|
|
401
|
+
interface ProfileBio3 {
|
|
402
|
+
description: string;
|
|
403
|
+
}
|
|
404
|
+
interface Privacy3 {
|
|
405
|
+
protected: boolean;
|
|
406
|
+
}
|
|
407
|
+
interface RelationshipPerspectives3 {
|
|
408
|
+
followed_by: boolean;
|
|
409
|
+
following: boolean;
|
|
410
|
+
}
|
|
411
|
+
interface TipjarSettings3 {
|
|
412
|
+
}
|
|
413
|
+
interface Verification3 {
|
|
414
|
+
verified: boolean;
|
|
116
415
|
}
|
|
117
416
|
interface ClientEventInfo {
|
|
118
417
|
component: string;
|
|
@@ -126,17 +425,4 @@ interface NotificationDetails {
|
|
|
126
425
|
impressionId: string;
|
|
127
426
|
metadata: string;
|
|
128
427
|
}
|
|
129
|
-
interface FeedbackInfo {
|
|
130
|
-
feedbackKeys: string[];
|
|
131
|
-
feedbackMetadata: string;
|
|
132
|
-
clientEventInfo: ClientEventInfo2;
|
|
133
|
-
}
|
|
134
|
-
interface ClientEventInfo2 {
|
|
135
|
-
element: string;
|
|
136
|
-
}
|
|
137
|
-
interface ClearEntriesUnreadState {
|
|
138
|
-
}
|
|
139
|
-
interface MarkEntriesUnreadGreaterThanSortIndex {
|
|
140
|
-
sortIndex: string;
|
|
141
|
-
}
|
|
142
428
|
export {};
|
package/package.json
CHANGED
|
@@ -1,9 +1,7 @@
|
|
|
1
1
|
import { NotificationType } from '../../enums/Notification';
|
|
2
|
-
import {
|
|
3
|
-
import { findKeyByValue } from '../../helper/JsonUtils';
|
|
2
|
+
import { findByFilter } from '../../helper/JsonUtils';
|
|
4
3
|
import { INotification } from '../../types/data/Notification';
|
|
5
4
|
import { INotification as IRawNotification } from '../../types/raw/base/Notification';
|
|
6
|
-
import { IUserNotificationsResponse } from '../../types/raw/user/Notifications';
|
|
7
5
|
|
|
8
6
|
/**
|
|
9
7
|
* The details of a single notification.
|
|
@@ -28,16 +26,16 @@ export class Notification implements INotification {
|
|
|
28
26
|
this._raw = { ...notification };
|
|
29
27
|
|
|
30
28
|
// Getting the original notification type
|
|
31
|
-
const notificationType
|
|
29
|
+
const notificationType = notification.notification_icon.toString();
|
|
32
30
|
|
|
33
|
-
this.from = notification.template
|
|
34
|
-
? notification.template.
|
|
31
|
+
this.from = notification.template.from_users
|
|
32
|
+
? notification.template.from_users.map((item) => item.user_results.result.rest_id)
|
|
35
33
|
: [];
|
|
36
34
|
this.id = notification.id;
|
|
37
|
-
this.message = notification.
|
|
38
|
-
this.receivedAt = new Date(
|
|
39
|
-
this.target = notification.template
|
|
40
|
-
? notification.template.
|
|
35
|
+
this.message = notification.rich_message.text;
|
|
36
|
+
this.receivedAt = new Date(notification.timestamp_ms).toISOString();
|
|
37
|
+
this.target = notification.template.target_objects
|
|
38
|
+
? notification.template.target_objects.map((item) => item.tweet_results.result.rest_id)
|
|
41
39
|
: [];
|
|
42
40
|
this.type = notificationType
|
|
43
41
|
? NotificationType[notificationType as keyof typeof NotificationType]
|
|
@@ -59,14 +57,12 @@ export class Notification implements INotification {
|
|
|
59
57
|
public static list(response: NonNullable<unknown>): Notification[] {
|
|
60
58
|
const notifications: Notification[] = [];
|
|
61
59
|
|
|
62
|
-
// Extracting
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
))
|
|
68
|
-
notifications.push(new Notification(value as IRawNotification));
|
|
69
|
-
}
|
|
60
|
+
// Extracting the matching data
|
|
61
|
+
const extract = findByFilter<IRawNotification>(response, '__typename', 'TimelineNotification');
|
|
62
|
+
|
|
63
|
+
// Deserializing valid data
|
|
64
|
+
for (const item of extract) {
|
|
65
|
+
notifications.push(new Notification(item));
|
|
70
66
|
}
|
|
71
67
|
|
|
72
68
|
return notifications;
|
|
@@ -1,6 +1,9 @@
|
|
|
1
1
|
/* eslint-disable */
|
|
2
2
|
|
|
3
3
|
import { RawNotificationType } from '../../../enums/raw/Notification';
|
|
4
|
+
import { IDataResult } from '../composite/DataResult';
|
|
5
|
+
import { ITweet } from './Tweet';
|
|
6
|
+
import { IUser } from './User';
|
|
4
7
|
|
|
5
8
|
/**
|
|
6
9
|
* Represents the raw data of a single Notification.
|
|
@@ -8,60 +11,56 @@ import { RawNotificationType } from '../../../enums/raw/Notification';
|
|
|
8
11
|
* @public
|
|
9
12
|
*/
|
|
10
13
|
export interface INotification {
|
|
14
|
+
itemType: string;
|
|
15
|
+
__typename: string;
|
|
11
16
|
id: string;
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
template:
|
|
17
|
+
notification_icon: RawNotificationType;
|
|
18
|
+
rich_message: INotificationRichMessage;
|
|
19
|
+
notification_url: INotificationUrl;
|
|
20
|
+
template: INoticiationTemplate;
|
|
21
|
+
timestamp_ms: string;
|
|
16
22
|
}
|
|
17
23
|
|
|
18
|
-
export interface
|
|
19
|
-
id: RawNotificationType;
|
|
20
|
-
}
|
|
21
|
-
|
|
22
|
-
export interface INotificationMessage {
|
|
23
|
-
text: string;
|
|
24
|
-
entities: INotificationMessageEntity[];
|
|
24
|
+
export interface INotificationRichMessage {
|
|
25
25
|
rtl: boolean;
|
|
26
|
+
text: string;
|
|
27
|
+
entities: INotificationEntity[];
|
|
26
28
|
}
|
|
27
29
|
|
|
28
|
-
export interface
|
|
30
|
+
export interface INotificationEntity {
|
|
29
31
|
fromIndex: number;
|
|
30
32
|
toIndex: number;
|
|
31
|
-
|
|
33
|
+
ref: INotificationEntityRef;
|
|
32
34
|
}
|
|
33
35
|
|
|
34
|
-
export interface
|
|
35
|
-
|
|
36
|
+
export interface INotificationEntityRef {
|
|
37
|
+
type: string;
|
|
38
|
+
user_results: IDataResult<IUser>;
|
|
36
39
|
}
|
|
37
40
|
|
|
38
|
-
export interface
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
41
|
+
export interface INotificationUrl {
|
|
42
|
+
url: string;
|
|
43
|
+
urlType: string;
|
|
44
|
+
urtEndpointOptions?: INotificationUrtEndpointOptions;
|
|
42
45
|
}
|
|
43
46
|
|
|
44
|
-
export interface
|
|
45
|
-
|
|
47
|
+
export interface INotificationUrtEndpointOptions {
|
|
48
|
+
cacheId: string;
|
|
49
|
+
title: string;
|
|
46
50
|
}
|
|
47
51
|
|
|
48
|
-
export interface
|
|
49
|
-
|
|
52
|
+
export interface INoticiationTemplate {
|
|
53
|
+
__typename: string;
|
|
54
|
+
target_objects: INotificationTargetObject[];
|
|
55
|
+
from_users: INotificationFromUser[];
|
|
50
56
|
}
|
|
51
57
|
|
|
52
|
-
export interface
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
export interface INotificationUser {
|
|
57
|
-
id: string;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
export interface INotificationAdditionalContext {
|
|
61
|
-
contextText: INotificationContextText;
|
|
58
|
+
export interface INotificationTargetObject {
|
|
59
|
+
__typename: string;
|
|
60
|
+
tweet_results: IDataResult<ITweet>;
|
|
62
61
|
}
|
|
63
62
|
|
|
64
|
-
export interface
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
export interface INotificationFromUser {
|
|
64
|
+
__typename: string;
|
|
65
|
+
user_results: IDataResult<IUser>;
|
|
67
66
|
}
|
|
@@ -6,141 +6,481 @@
|
|
|
6
6
|
* @public
|
|
7
7
|
*/
|
|
8
8
|
export interface IUserNotificationsResponse {
|
|
9
|
-
|
|
10
|
-
|
|
9
|
+
data: Data;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
interface Data {
|
|
13
|
+
viewer_v2: ViewerV2;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
interface ViewerV2 {
|
|
17
|
+
user_results: UserResults;
|
|
11
18
|
}
|
|
12
19
|
|
|
13
|
-
interface
|
|
14
|
-
|
|
20
|
+
interface UserResults {
|
|
21
|
+
result: Result;
|
|
15
22
|
}
|
|
16
23
|
|
|
17
|
-
interface
|
|
18
|
-
|
|
24
|
+
interface Result {
|
|
25
|
+
__typename: string;
|
|
26
|
+
rest_id: string;
|
|
27
|
+
notification_timeline: NotificationTimeline;
|
|
19
28
|
}
|
|
20
29
|
|
|
21
|
-
interface
|
|
30
|
+
interface NotificationTimeline {
|
|
22
31
|
id: string;
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
32
|
+
timeline: Timeline;
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
interface Timeline {
|
|
36
|
+
instructions: Instruction[];
|
|
37
|
+
}
|
|
38
|
+
|
|
39
|
+
interface Instruction {
|
|
40
|
+
type: string;
|
|
41
|
+
entries?: Entry[];
|
|
42
|
+
sort_index?: string;
|
|
27
43
|
}
|
|
28
44
|
|
|
29
|
-
interface
|
|
45
|
+
interface Entry {
|
|
46
|
+
entryId: string;
|
|
47
|
+
sortIndex: string;
|
|
48
|
+
content: Content;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
interface Content {
|
|
52
|
+
entryType: string;
|
|
53
|
+
__typename: string;
|
|
54
|
+
value?: string;
|
|
55
|
+
cursorType?: string;
|
|
56
|
+
itemContent?: ItemContent;
|
|
57
|
+
clientEventInfo?: ClientEventInfo;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
interface ItemContent {
|
|
61
|
+
itemType: string;
|
|
62
|
+
__typename: string;
|
|
30
63
|
id: string;
|
|
64
|
+
notification_icon: string;
|
|
65
|
+
rich_message: RichMessage;
|
|
66
|
+
notification_url: NotificationUrl;
|
|
67
|
+
template: Template;
|
|
68
|
+
timestamp_ms: string;
|
|
31
69
|
}
|
|
32
70
|
|
|
33
|
-
interface
|
|
71
|
+
interface RichMessage {
|
|
72
|
+
rtl: boolean;
|
|
34
73
|
text: string;
|
|
35
74
|
entities: Entity[];
|
|
36
|
-
rtl: boolean;
|
|
37
75
|
}
|
|
38
76
|
|
|
39
77
|
interface Entity {
|
|
40
78
|
fromIndex: number;
|
|
41
79
|
toIndex: number;
|
|
42
|
-
|
|
80
|
+
ref: Ref;
|
|
43
81
|
}
|
|
44
82
|
|
|
45
|
-
interface
|
|
46
|
-
|
|
83
|
+
interface Ref {
|
|
84
|
+
type: string;
|
|
85
|
+
user_results: UserResults2;
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
interface UserResults2 {
|
|
89
|
+
result: Result2;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
interface Result2 {
|
|
93
|
+
__typename: string;
|
|
94
|
+
id: string;
|
|
95
|
+
rest_id: string;
|
|
96
|
+
affiliates_highlighted_label: AffiliatesHighlightedLabel;
|
|
97
|
+
avatar: Avatar;
|
|
98
|
+
core: Core;
|
|
99
|
+
dm_permissions: DmPermissions;
|
|
100
|
+
follow_request_sent: boolean;
|
|
101
|
+
has_graduated_access: boolean;
|
|
102
|
+
is_blue_verified: boolean;
|
|
103
|
+
legacy: Legacy;
|
|
104
|
+
location: Location;
|
|
105
|
+
media_permissions: MediaPermissions;
|
|
106
|
+
parody_commentary_fan_label: string;
|
|
107
|
+
profile_image_shape: string;
|
|
108
|
+
profile_bio: ProfileBio;
|
|
109
|
+
privacy: Privacy;
|
|
110
|
+
relationship_perspectives: RelationshipPerspectives;
|
|
111
|
+
tipjar_settings: TipjarSettings;
|
|
112
|
+
verification: Verification;
|
|
113
|
+
verified_phone_status: boolean;
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
interface AffiliatesHighlightedLabel {}
|
|
117
|
+
|
|
118
|
+
interface Avatar {
|
|
119
|
+
image_url: string;
|
|
47
120
|
}
|
|
48
121
|
|
|
49
|
-
interface
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
122
|
+
interface Core {
|
|
123
|
+
created_at: string;
|
|
124
|
+
name: string;
|
|
125
|
+
screen_name: string;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
interface DmPermissions {
|
|
129
|
+
can_dm: boolean;
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
interface Legacy {
|
|
133
|
+
default_profile: boolean;
|
|
134
|
+
default_profile_image: boolean;
|
|
135
|
+
description: string;
|
|
136
|
+
entities: Entities;
|
|
137
|
+
fast_followers_count: number;
|
|
138
|
+
favourites_count: number;
|
|
139
|
+
followers_count: number;
|
|
140
|
+
friends_count: number;
|
|
141
|
+
has_custom_timelines: boolean;
|
|
142
|
+
is_translator: boolean;
|
|
143
|
+
listed_count: number;
|
|
144
|
+
media_count: number;
|
|
145
|
+
normal_followers_count: number;
|
|
146
|
+
notifications: boolean;
|
|
147
|
+
pinned_tweet_ids_str: any[];
|
|
148
|
+
possibly_sensitive: boolean;
|
|
149
|
+
profile_interstitial_type: string;
|
|
150
|
+
statuses_count: number;
|
|
151
|
+
translator_type: string;
|
|
152
|
+
want_retweets: boolean;
|
|
153
|
+
withheld_in_countries: any[];
|
|
154
|
+
}
|
|
155
|
+
|
|
156
|
+
interface Entities {
|
|
157
|
+
description: Description;
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
interface Description {
|
|
161
|
+
urls: any[];
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
interface Location {
|
|
165
|
+
location: string;
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
interface MediaPermissions {
|
|
169
|
+
can_media_tag: boolean;
|
|
170
|
+
}
|
|
171
|
+
|
|
172
|
+
interface ProfileBio {
|
|
173
|
+
description: string;
|
|
174
|
+
}
|
|
175
|
+
|
|
176
|
+
interface Privacy {
|
|
177
|
+
protected: boolean;
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
interface RelationshipPerspectives {
|
|
181
|
+
followed_by: boolean;
|
|
182
|
+
following: boolean;
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
interface TipjarSettings {}
|
|
186
|
+
|
|
187
|
+
interface Verification {
|
|
188
|
+
verified: boolean;
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
interface NotificationUrl {
|
|
192
|
+
url: string;
|
|
193
|
+
urlType: string;
|
|
194
|
+
urtEndpointOptions?: UrtEndpointOptions;
|
|
195
|
+
}
|
|
196
|
+
|
|
197
|
+
interface UrtEndpointOptions {
|
|
198
|
+
cacheId: string;
|
|
199
|
+
title: string;
|
|
200
|
+
}
|
|
201
|
+
|
|
202
|
+
interface Template {
|
|
203
|
+
__typename: string;
|
|
204
|
+
target_objects: TargetObject[];
|
|
205
|
+
from_users: FromUser[];
|
|
53
206
|
}
|
|
54
207
|
|
|
55
208
|
interface TargetObject {
|
|
56
|
-
|
|
209
|
+
__typename: string;
|
|
210
|
+
tweet_results: TweetResults;
|
|
57
211
|
}
|
|
58
212
|
|
|
59
|
-
interface
|
|
60
|
-
|
|
213
|
+
interface TweetResults {
|
|
214
|
+
result: Result3;
|
|
61
215
|
}
|
|
62
216
|
|
|
63
|
-
interface
|
|
64
|
-
|
|
217
|
+
interface Result3 {
|
|
218
|
+
__typename: string;
|
|
219
|
+
rest_id: string;
|
|
220
|
+
core: Core2;
|
|
221
|
+
unmention_data: UnmentionData;
|
|
222
|
+
edit_control: EditControl;
|
|
223
|
+
is_translatable: boolean;
|
|
224
|
+
views: Views;
|
|
225
|
+
source: string;
|
|
226
|
+
grok_analysis_button: boolean;
|
|
227
|
+
legacy: Legacy3;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
interface Core2 {
|
|
231
|
+
user_results: UserResults3;
|
|
232
|
+
}
|
|
233
|
+
|
|
234
|
+
interface UserResults3 {
|
|
235
|
+
result: Result4;
|
|
65
236
|
}
|
|
66
237
|
|
|
67
|
-
interface
|
|
238
|
+
interface Result4 {
|
|
239
|
+
__typename: string;
|
|
68
240
|
id: string;
|
|
241
|
+
rest_id: string;
|
|
242
|
+
affiliates_highlighted_label: AffiliatesHighlightedLabel2;
|
|
243
|
+
avatar: Avatar2;
|
|
244
|
+
core: Core3;
|
|
245
|
+
dm_permissions: DmPermissions2;
|
|
246
|
+
follow_request_sent: boolean;
|
|
247
|
+
has_graduated_access: boolean;
|
|
248
|
+
is_blue_verified: boolean;
|
|
249
|
+
legacy: Legacy2;
|
|
250
|
+
location: Location2;
|
|
251
|
+
media_permissions: MediaPermissions2;
|
|
252
|
+
parody_commentary_fan_label: string;
|
|
253
|
+
profile_image_shape: string;
|
|
254
|
+
profile_bio: ProfileBio2;
|
|
255
|
+
privacy: Privacy2;
|
|
256
|
+
relationship_perspectives: RelationshipPerspectives2;
|
|
257
|
+
tipjar_settings: TipjarSettings2;
|
|
258
|
+
verification: Verification2;
|
|
259
|
+
verified_phone_status: boolean;
|
|
69
260
|
}
|
|
70
261
|
|
|
71
|
-
interface
|
|
72
|
-
|
|
262
|
+
interface AffiliatesHighlightedLabel2 {}
|
|
263
|
+
|
|
264
|
+
interface Avatar2 {
|
|
265
|
+
image_url: string;
|
|
73
266
|
}
|
|
74
267
|
|
|
75
|
-
interface
|
|
76
|
-
|
|
77
|
-
|
|
268
|
+
interface Core3 {
|
|
269
|
+
created_at: string;
|
|
270
|
+
name: string;
|
|
271
|
+
screen_name: string;
|
|
78
272
|
}
|
|
79
273
|
|
|
80
|
-
interface
|
|
81
|
-
|
|
82
|
-
instructions: Instruction[];
|
|
274
|
+
interface DmPermissions2 {
|
|
275
|
+
can_dm: boolean;
|
|
83
276
|
}
|
|
84
277
|
|
|
85
|
-
interface
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
278
|
+
interface Legacy2 {
|
|
279
|
+
default_profile: boolean;
|
|
280
|
+
default_profile_image: boolean;
|
|
281
|
+
description: string;
|
|
282
|
+
entities: Entities2;
|
|
283
|
+
fast_followers_count: number;
|
|
284
|
+
favourites_count: number;
|
|
285
|
+
followers_count: number;
|
|
286
|
+
friends_count: number;
|
|
287
|
+
has_custom_timelines: boolean;
|
|
288
|
+
is_translator: boolean;
|
|
289
|
+
listed_count: number;
|
|
290
|
+
media_count: number;
|
|
291
|
+
needs_phone_verification: boolean;
|
|
292
|
+
normal_followers_count: number;
|
|
293
|
+
pinned_tweet_ids_str: any[];
|
|
294
|
+
possibly_sensitive: boolean;
|
|
295
|
+
profile_interstitial_type: string;
|
|
296
|
+
statuses_count: number;
|
|
297
|
+
translator_type: string;
|
|
298
|
+
want_retweets: boolean;
|
|
299
|
+
withheld_in_countries: any[];
|
|
90
300
|
}
|
|
91
301
|
|
|
92
|
-
interface
|
|
302
|
+
interface Entities2 {
|
|
303
|
+
description: Description2;
|
|
304
|
+
}
|
|
93
305
|
|
|
94
|
-
interface
|
|
95
|
-
|
|
306
|
+
interface Description2 {
|
|
307
|
+
urls: any[];
|
|
96
308
|
}
|
|
97
309
|
|
|
98
|
-
interface
|
|
99
|
-
|
|
100
|
-
sortIndex: string;
|
|
101
|
-
content: Content;
|
|
310
|
+
interface Location2 {
|
|
311
|
+
location: string;
|
|
102
312
|
}
|
|
103
313
|
|
|
104
|
-
interface
|
|
105
|
-
|
|
106
|
-
item?: Item;
|
|
314
|
+
interface MediaPermissions2 {
|
|
315
|
+
can_media_tag: boolean;
|
|
107
316
|
}
|
|
108
317
|
|
|
109
|
-
interface
|
|
110
|
-
|
|
318
|
+
interface ProfileBio2 {
|
|
319
|
+
description: string;
|
|
111
320
|
}
|
|
112
321
|
|
|
113
|
-
interface
|
|
114
|
-
|
|
115
|
-
cursorType: string;
|
|
322
|
+
interface Privacy2 {
|
|
323
|
+
protected: boolean;
|
|
116
324
|
}
|
|
117
325
|
|
|
118
|
-
interface
|
|
119
|
-
|
|
120
|
-
clientEventInfo: ClientEventInfo;
|
|
121
|
-
feedbackInfo?: FeedbackInfo;
|
|
326
|
+
interface RelationshipPerspectives2 {
|
|
327
|
+
following: boolean;
|
|
122
328
|
}
|
|
123
329
|
|
|
124
|
-
interface
|
|
125
|
-
|
|
330
|
+
interface TipjarSettings2 {}
|
|
331
|
+
|
|
332
|
+
interface Verification2 {
|
|
333
|
+
verified: boolean;
|
|
126
334
|
}
|
|
127
335
|
|
|
128
|
-
interface
|
|
336
|
+
interface UnmentionData {}
|
|
337
|
+
|
|
338
|
+
interface EditControl {
|
|
339
|
+
edit_tweet_ids: string[];
|
|
340
|
+
editable_until_msecs: string;
|
|
341
|
+
is_edit_eligible: boolean;
|
|
342
|
+
edits_remaining: string;
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
interface Views {
|
|
346
|
+
count: string;
|
|
347
|
+
state: string;
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
interface Legacy3 {
|
|
351
|
+
bookmark_count: number;
|
|
352
|
+
bookmarked: boolean;
|
|
353
|
+
created_at: string;
|
|
354
|
+
conversation_id_str: string;
|
|
355
|
+
display_text_range: number[];
|
|
356
|
+
entities: Entities3;
|
|
357
|
+
favorite_count: number;
|
|
358
|
+
favorited: boolean;
|
|
359
|
+
full_text: string;
|
|
360
|
+
is_quote_status: boolean;
|
|
361
|
+
lang: string;
|
|
362
|
+
quote_count: number;
|
|
363
|
+
reply_count: number;
|
|
364
|
+
retweet_count: number;
|
|
365
|
+
retweeted: boolean;
|
|
366
|
+
user_id_str: string;
|
|
367
|
+
id_str: string;
|
|
368
|
+
}
|
|
369
|
+
|
|
370
|
+
interface Entities3 {
|
|
371
|
+
hashtags: any[];
|
|
372
|
+
symbols: any[];
|
|
373
|
+
timestamps: any[];
|
|
374
|
+
urls: any[];
|
|
375
|
+
user_mentions: any[];
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
interface FromUser {
|
|
379
|
+
__typename: string;
|
|
380
|
+
user_results: UserResults4;
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
interface UserResults4 {
|
|
384
|
+
result: Result5;
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
interface Result5 {
|
|
388
|
+
__typename: string;
|
|
129
389
|
id: string;
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
390
|
+
rest_id: string;
|
|
391
|
+
affiliates_highlighted_label: AffiliatesHighlightedLabel3;
|
|
392
|
+
avatar: Avatar3;
|
|
393
|
+
core: Core4;
|
|
394
|
+
dm_permissions: DmPermissions3;
|
|
395
|
+
follow_request_sent: boolean;
|
|
396
|
+
has_graduated_access: boolean;
|
|
397
|
+
is_blue_verified: boolean;
|
|
398
|
+
legacy: Legacy4;
|
|
399
|
+
location: Location3;
|
|
400
|
+
media_permissions: MediaPermissions3;
|
|
401
|
+
parody_commentary_fan_label: string;
|
|
402
|
+
profile_image_shape: string;
|
|
403
|
+
profile_bio: ProfileBio3;
|
|
404
|
+
privacy: Privacy3;
|
|
405
|
+
relationship_perspectives: RelationshipPerspectives3;
|
|
406
|
+
tipjar_settings: TipjarSettings3;
|
|
407
|
+
verification: Verification3;
|
|
408
|
+
verified_phone_status: boolean;
|
|
133
409
|
}
|
|
134
410
|
|
|
135
|
-
interface
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
411
|
+
interface AffiliatesHighlightedLabel3 {}
|
|
412
|
+
|
|
413
|
+
interface Avatar3 {
|
|
414
|
+
image_url: string;
|
|
139
415
|
}
|
|
140
416
|
|
|
141
|
-
interface
|
|
142
|
-
|
|
143
|
-
|
|
417
|
+
interface Core4 {
|
|
418
|
+
created_at: string;
|
|
419
|
+
name: string;
|
|
420
|
+
screen_name: string;
|
|
421
|
+
}
|
|
422
|
+
|
|
423
|
+
interface DmPermissions3 {
|
|
424
|
+
can_dm: boolean;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
interface Legacy4 {
|
|
428
|
+
default_profile: boolean;
|
|
429
|
+
default_profile_image: boolean;
|
|
430
|
+
description: string;
|
|
431
|
+
entities: Entities4;
|
|
432
|
+
fast_followers_count: number;
|
|
433
|
+
favourites_count: number;
|
|
434
|
+
followers_count: number;
|
|
435
|
+
friends_count: number;
|
|
436
|
+
has_custom_timelines: boolean;
|
|
437
|
+
is_translator: boolean;
|
|
438
|
+
listed_count: number;
|
|
439
|
+
media_count: number;
|
|
440
|
+
normal_followers_count: number;
|
|
441
|
+
notifications: boolean;
|
|
442
|
+
pinned_tweet_ids_str: any[];
|
|
443
|
+
possibly_sensitive: boolean;
|
|
444
|
+
profile_interstitial_type: string;
|
|
445
|
+
statuses_count: number;
|
|
446
|
+
translator_type: string;
|
|
447
|
+
want_retweets: boolean;
|
|
448
|
+
withheld_in_countries: any[];
|
|
449
|
+
}
|
|
450
|
+
|
|
451
|
+
interface Entities4 {
|
|
452
|
+
description: Description3;
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
interface Description3 {
|
|
456
|
+
urls: any[];
|
|
457
|
+
}
|
|
458
|
+
|
|
459
|
+
interface Location3 {
|
|
460
|
+
location: string;
|
|
461
|
+
}
|
|
462
|
+
|
|
463
|
+
interface MediaPermissions3 {
|
|
464
|
+
can_media_tag: boolean;
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
interface ProfileBio3 {
|
|
468
|
+
description: string;
|
|
469
|
+
}
|
|
470
|
+
|
|
471
|
+
interface Privacy3 {
|
|
472
|
+
protected: boolean;
|
|
473
|
+
}
|
|
474
|
+
|
|
475
|
+
interface RelationshipPerspectives3 {
|
|
476
|
+
followed_by: boolean;
|
|
477
|
+
following: boolean;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
interface TipjarSettings3 {}
|
|
481
|
+
|
|
482
|
+
interface Verification3 {
|
|
483
|
+
verified: boolean;
|
|
144
484
|
}
|
|
145
485
|
|
|
146
486
|
interface ClientEventInfo {
|
|
@@ -157,19 +497,3 @@ interface NotificationDetails {
|
|
|
157
497
|
impressionId: string;
|
|
158
498
|
metadata: string;
|
|
159
499
|
}
|
|
160
|
-
|
|
161
|
-
interface FeedbackInfo {
|
|
162
|
-
feedbackKeys: string[];
|
|
163
|
-
feedbackMetadata: string;
|
|
164
|
-
clientEventInfo: ClientEventInfo2;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
interface ClientEventInfo2 {
|
|
168
|
-
element: string;
|
|
169
|
-
}
|
|
170
|
-
|
|
171
|
-
interface ClearEntriesUnreadState {}
|
|
172
|
-
|
|
173
|
-
interface MarkEntriesUnreadGreaterThanSortIndex {
|
|
174
|
-
sortIndex: string;
|
|
175
|
-
}
|