rettiwt-api 6.0.8 → 6.1.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/.github/ISSUE_TEMPLATE/bug-report.yml +57 -0
- package/.github/ISSUE_TEMPLATE/feature-request.yml +20 -0
- package/.github/ISSUE_TEMPLATE/question.yml +15 -0
- package/.github/PULL_REQUEST_TEMPLATE.md +32 -0
- package/.github/workflows/ci.yml +33 -0
- package/.nvmrc +1 -0
- package/README.md +30 -6
- package/dist/Rettiwt.d.ts +3 -0
- package/dist/Rettiwt.js +4 -0
- package/dist/Rettiwt.js.map +1 -1
- package/dist/cli.js +2 -0
- package/dist/cli.js.map +1 -1
- package/dist/collections/Extractors.d.ts +24 -0
- package/dist/collections/Extractors.js +14 -0
- package/dist/collections/Extractors.js.map +1 -1
- package/dist/collections/Groups.js +11 -0
- package/dist/collections/Groups.js.map +1 -1
- package/dist/collections/Requests.js +12 -0
- package/dist/collections/Requests.js.map +1 -1
- package/dist/commands/DirectMessage.d.ts +10 -0
- package/dist/commands/DirectMessage.js +57 -0
- package/dist/commands/DirectMessage.js.map +1 -0
- package/dist/commands/List.js +44 -3
- package/dist/commands/List.js.map +1 -1
- package/dist/commands/Tweet.js +29 -1
- package/dist/commands/Tweet.js.map +1 -1
- package/dist/commands/User.js +39 -1
- package/dist/commands/User.js.map +1 -1
- package/dist/enums/Data.d.ts +3 -1
- package/dist/enums/Data.js +2 -0
- package/dist/enums/Data.js.map +1 -1
- package/dist/enums/Resource.d.ts +11 -0
- package/dist/enums/Resource.js +12 -0
- package/dist/enums/Resource.js.map +1 -1
- package/dist/enums/raw/Analytics.d.ts +6 -3
- package/dist/enums/raw/Analytics.js +5 -2
- package/dist/enums/raw/Analytics.js.map +1 -1
- package/dist/index.d.ts +15 -0
- package/dist/index.js +8 -0
- package/dist/index.js.map +1 -1
- package/dist/models/args/FetchArgs.d.ts +9 -0
- package/dist/models/args/FetchArgs.js +16 -0
- package/dist/models/args/FetchArgs.js.map +1 -1
- package/dist/models/args/PostArgs.d.ts +1 -0
- package/dist/models/args/PostArgs.js +2 -0
- package/dist/models/args/PostArgs.js.map +1 -1
- package/dist/models/data/Analytics.d.ts +43 -0
- package/dist/models/data/Analytics.js +92 -0
- package/dist/models/data/Analytics.js.map +1 -0
- package/dist/models/data/Conversation.d.ts +93 -0
- package/dist/models/data/Conversation.js +293 -0
- package/dist/models/data/Conversation.js.map +1 -0
- package/dist/models/data/CursoredData.d.ts +2 -1
- package/dist/models/data/CursoredData.js +6 -1
- package/dist/models/data/CursoredData.js.map +1 -1
- package/dist/models/data/DirectMessage.d.ts +105 -0
- package/dist/models/data/DirectMessage.js +284 -0
- package/dist/models/data/DirectMessage.js.map +1 -0
- package/dist/models/data/Inbox.d.ts +44 -0
- package/dist/models/data/Inbox.js +106 -0
- package/dist/models/data/Inbox.js.map +1 -0
- package/dist/models/data/List.d.ts +20 -0
- package/dist/models/data/List.js +50 -1
- package/dist/models/data/List.js.map +1 -1
- package/dist/models/data/Tweet.d.ts +6 -6
- package/dist/models/data/Tweet.js +4 -2
- package/dist/models/data/Tweet.js.map +1 -1
- package/dist/models/data/User.d.ts +2 -0
- package/dist/models/data/User.js +6 -0
- package/dist/models/data/User.js.map +1 -1
- package/dist/requests/DirectMessage.d.ts +28 -0
- package/dist/requests/DirectMessage.js +149 -0
- package/dist/requests/DirectMessage.js.map +1 -0
- package/dist/requests/List.d.ts +10 -0
- package/dist/requests/List.js +52 -0
- package/dist/requests/List.js.map +1 -1
- package/dist/requests/Tweet.d.ts +8 -0
- package/dist/requests/Tweet.js +30 -0
- package/dist/requests/Tweet.js.map +1 -1
- package/dist/requests/User.d.ts +8 -1
- package/dist/requests/User.js +67 -8
- package/dist/requests/User.js.map +1 -1
- package/dist/services/public/DirectMessageService.d.ts +100 -0
- package/dist/services/public/DirectMessageService.js +143 -0
- package/dist/services/public/DirectMessageService.js.map +1 -0
- package/dist/services/public/FetcherService.d.ts +2 -2
- package/dist/services/public/FetcherService.js +2 -2
- package/dist/services/public/ListService.d.ts +85 -0
- package/dist/services/public/ListService.js +111 -0
- package/dist/services/public/ListService.js.map +1 -1
- package/dist/services/public/TweetService.d.ts +56 -0
- package/dist/services/public/TweetService.js +72 -0
- package/dist/services/public/TweetService.js.map +1 -1
- package/dist/services/public/UserService.d.ts +61 -2
- package/dist/services/public/UserService.js +89 -0
- package/dist/services/public/UserService.js.map +1 -1
- package/dist/types/args/FetchArgs.d.ts +69 -12
- package/dist/types/args/PostArgs.d.ts +29 -11
- package/dist/types/data/Analytics.d.ts +42 -0
- package/dist/types/data/Analytics.js +3 -0
- package/dist/types/data/Analytics.js.map +1 -0
- package/dist/types/data/Conversation.d.ts +32 -0
- package/dist/types/data/Conversation.js +3 -0
- package/dist/types/data/Conversation.js.map +1 -0
- package/dist/types/data/CursoredData.d.ts +4 -1
- package/dist/types/data/DirectMessage.d.ts +25 -0
- package/dist/types/data/DirectMessage.js +3 -0
- package/dist/types/data/DirectMessage.js.map +1 -0
- package/dist/types/data/Inbox.d.ts +18 -0
- package/dist/types/data/Inbox.js +3 -0
- package/dist/types/data/Inbox.js.map +1 -0
- package/dist/types/data/List.d.ts +5 -1
- package/dist/types/data/Tweet.d.ts +6 -6
- package/dist/types/data/User.d.ts +4 -0
- package/dist/types/raw/base/Analytic.d.ts +6 -1
- package/dist/types/raw/base/Message.d.ts +16 -0
- package/dist/types/raw/base/Message.js +4 -0
- package/dist/types/raw/base/Message.js.map +1 -0
- package/dist/types/raw/base/Tweet.d.ts +6 -6
- package/dist/types/raw/base/User.d.ts +2 -1
- package/dist/types/raw/composite/TimelineList.d.ts +9 -0
- package/dist/types/raw/composite/TimelineList.js +3 -0
- package/dist/types/raw/composite/TimelineList.js.map +1 -0
- package/dist/types/raw/dm/Conversation.d.ts +55 -0
- package/dist/types/raw/dm/Conversation.js +4 -0
- package/dist/types/raw/dm/Conversation.js.map +1 -0
- package/dist/types/raw/dm/InboxInitial.d.ts +137 -0
- package/dist/types/raw/dm/InboxInitial.js +4 -0
- package/dist/types/raw/dm/InboxInitial.js.map +1 -0
- package/dist/types/raw/dm/InboxTimeline.d.ts +287 -0
- package/dist/types/raw/dm/InboxTimeline.js +4 -0
- package/dist/types/raw/dm/InboxTimeline.js.map +1 -0
- package/dist/types/raw/dm/UserUpdates.d.ts +41 -0
- package/dist/types/raw/dm/UserUpdates.js +4 -0
- package/dist/types/raw/dm/UserUpdates.js.map +1 -0
- package/dist/types/raw/list/AddMember.d.ts +151 -0
- package/dist/types/raw/list/AddMember.js +4 -0
- package/dist/types/raw/list/AddMember.js.map +1 -0
- package/dist/types/raw/list/Details.d.ts +44 -13
- package/dist/types/raw/list/RemoveMember.d.ts +150 -0
- package/dist/types/raw/list/RemoveMember.js +4 -0
- package/dist/types/raw/list/RemoveMember.js.map +1 -0
- package/dist/types/raw/tweet/Bookmark.d.ts +12 -0
- package/dist/types/raw/tweet/Bookmark.js +4 -0
- package/dist/types/raw/tweet/Bookmark.js.map +1 -0
- package/dist/types/raw/tweet/Unbookmark.d.ts +11 -0
- package/dist/types/raw/tweet/Unbookmark.js +4 -0
- package/dist/types/raw/tweet/Unbookmark.js.map +1 -0
- package/dist/types/raw/user/Analytics.d.ts +6 -18
- package/dist/types/raw/user/Analytics.js +0 -1
- package/dist/types/raw/user/Analytics.js.map +1 -1
- package/dist/types/raw/user/Lists.d.ts +319 -0
- package/dist/types/raw/user/Lists.js +4 -0
- package/dist/types/raw/user/Lists.js.map +1 -0
- package/eslint.config.mjs +1 -1
- package/package.json +11 -6
- package/playground/.env.example +1 -0
- package/playground/README.md +53 -0
- package/playground/index.js +15 -0
- package/playground/package.json +15 -0
- package/src/Rettiwt.ts +5 -0
- package/src/cli.ts +2 -0
- package/src/collections/Extractors.ts +29 -0
- package/src/collections/Groups.ts +11 -0
- package/src/collections/Requests.ts +20 -0
- package/src/commands/DirectMessage.ts +62 -0
- package/src/commands/List.ts +44 -3
- package/src/commands/Tweet.ts +29 -1
- package/src/commands/User.ts +65 -1
- package/src/enums/Data.ts +2 -0
- package/src/enums/Resource.ts +13 -0
- package/src/enums/raw/Analytics.ts +5 -2
- package/src/index.ts +15 -0
- package/src/models/args/FetchArgs.ts +17 -0
- package/src/models/args/PostArgs.ts +2 -0
- package/src/models/data/Analytics.ts +97 -0
- package/src/models/data/Conversation.ts +344 -0
- package/src/models/data/CursoredData.ts +7 -2
- package/src/models/data/DirectMessage.ts +335 -0
- package/src/models/data/Inbox.ts +124 -0
- package/src/models/data/List.ts +60 -1
- package/src/models/data/Tweet.ts +10 -8
- package/src/models/data/User.ts +6 -0
- package/src/requests/DirectMessage.ts +233 -0
- package/src/requests/List.ts +58 -0
- package/src/requests/Tweet.ts +32 -0
- package/src/requests/User.ts +70 -7
- package/src/services/public/DirectMessageService.ts +159 -0
- package/src/services/public/FetcherService.ts +2 -2
- package/src/services/public/ListService.ts +127 -0
- package/src/services/public/TweetService.ts +82 -0
- package/src/services/public/UserService.ts +110 -2
- package/src/types/args/FetchArgs.ts +77 -12
- package/src/types/args/PostArgs.ts +31 -11
- package/src/types/data/Analytics.ts +58 -0
- package/src/types/data/Conversation.ts +44 -0
- package/src/types/data/CursoredData.ts +4 -1
- package/src/types/data/DirectMessage.ts +33 -0
- package/src/types/data/Inbox.ts +23 -0
- package/src/types/data/List.ts +7 -1
- package/src/types/data/Tweet.ts +6 -6
- package/src/types/data/User.ts +6 -0
- package/src/types/raw/base/Analytic.ts +7 -1
- package/src/types/raw/base/Message.ts +22 -0
- package/src/types/raw/base/Tweet.ts +6 -6
- package/src/types/raw/base/User.ts +2 -1
- package/src/types/raw/composite/TimelineList.ts +10 -0
- package/src/types/raw/dm/Conversation.ts +59 -0
- package/src/types/raw/dm/InboxInitial.ts +155 -0
- package/src/types/raw/dm/InboxTimeline.ts +301 -0
- package/src/types/raw/dm/UserUpdates.ts +46 -0
- package/src/types/raw/list/AddMember.ts +175 -0
- package/src/types/raw/list/Details.ts +52 -13
- package/src/types/raw/list/RemoveMember.ts +174 -0
- package/src/types/raw/tweet/Bookmark.ts +14 -0
- package/src/types/raw/tweet/Unbookmark.ts +14 -0
- package/src/types/raw/user/Analytics.ts +6 -22
- package/src/types/raw/user/Lists.ts +378 -0
- package/tsconfig.json +1 -1
|
@@ -0,0 +1,150 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The raw data received after removing a member from a tweet list.
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export interface IListMemberRemoveResponse {
|
|
7
|
+
data: Data;
|
|
8
|
+
}
|
|
9
|
+
export interface Data {
|
|
10
|
+
list: List;
|
|
11
|
+
}
|
|
12
|
+
export interface List {
|
|
13
|
+
created_at: number;
|
|
14
|
+
default_banner_media: DefaultBannerMedia;
|
|
15
|
+
default_banner_media_results: DefaultBannerMediaResults;
|
|
16
|
+
description: string;
|
|
17
|
+
facepile_urls: any[];
|
|
18
|
+
following: boolean;
|
|
19
|
+
id: string;
|
|
20
|
+
id_str: string;
|
|
21
|
+
is_member: boolean;
|
|
22
|
+
member_count: number;
|
|
23
|
+
mode: string;
|
|
24
|
+
muting: boolean;
|
|
25
|
+
name: string;
|
|
26
|
+
pinning: boolean;
|
|
27
|
+
subscriber_count: number;
|
|
28
|
+
user_results: UserResults;
|
|
29
|
+
}
|
|
30
|
+
export interface DefaultBannerMedia {
|
|
31
|
+
media_info: MediaInfo;
|
|
32
|
+
}
|
|
33
|
+
export interface MediaInfo {
|
|
34
|
+
original_img_url: string;
|
|
35
|
+
original_img_width: number;
|
|
36
|
+
original_img_height: number;
|
|
37
|
+
salient_rect: SalientRect;
|
|
38
|
+
}
|
|
39
|
+
export interface SalientRect {
|
|
40
|
+
left: number;
|
|
41
|
+
top: number;
|
|
42
|
+
width: number;
|
|
43
|
+
height: number;
|
|
44
|
+
}
|
|
45
|
+
export interface DefaultBannerMediaResults {
|
|
46
|
+
result: Result;
|
|
47
|
+
}
|
|
48
|
+
export interface Result {
|
|
49
|
+
id: string;
|
|
50
|
+
media_key: string;
|
|
51
|
+
media_id: string;
|
|
52
|
+
media_info: MediaInfo2;
|
|
53
|
+
__typename: string;
|
|
54
|
+
}
|
|
55
|
+
export interface MediaInfo2 {
|
|
56
|
+
__typename: string;
|
|
57
|
+
original_img_height: number;
|
|
58
|
+
original_img_width: number;
|
|
59
|
+
original_img_url: string;
|
|
60
|
+
salient_rect: SalientRect2;
|
|
61
|
+
}
|
|
62
|
+
export interface SalientRect2 {
|
|
63
|
+
height: number;
|
|
64
|
+
left: number;
|
|
65
|
+
top: number;
|
|
66
|
+
width: number;
|
|
67
|
+
}
|
|
68
|
+
export interface UserResults {
|
|
69
|
+
result: Result2;
|
|
70
|
+
}
|
|
71
|
+
export interface Result2 {
|
|
72
|
+
__typename: string;
|
|
73
|
+
id: string;
|
|
74
|
+
rest_id: string;
|
|
75
|
+
affiliates_highlighted_label: AffiliatesHighlightedLabel;
|
|
76
|
+
avatar: Avatar;
|
|
77
|
+
core: Core;
|
|
78
|
+
dm_permissions: DmPermissions;
|
|
79
|
+
has_graduated_access: boolean;
|
|
80
|
+
is_blue_verified: boolean;
|
|
81
|
+
legacy: Legacy;
|
|
82
|
+
location: Location;
|
|
83
|
+
media_permissions: MediaPermissions;
|
|
84
|
+
parody_commentary_fan_label: string;
|
|
85
|
+
profile_image_shape: string;
|
|
86
|
+
privacy: Privacy;
|
|
87
|
+
relationship_perspectives: RelationshipPerspectives;
|
|
88
|
+
tipjar_settings: TipjarSettings;
|
|
89
|
+
verification: Verification;
|
|
90
|
+
verified_phone_status: boolean;
|
|
91
|
+
}
|
|
92
|
+
export interface AffiliatesHighlightedLabel {
|
|
93
|
+
}
|
|
94
|
+
export interface Avatar {
|
|
95
|
+
image_url: string;
|
|
96
|
+
}
|
|
97
|
+
export interface Core {
|
|
98
|
+
created_at: string;
|
|
99
|
+
name: string;
|
|
100
|
+
screen_name: string;
|
|
101
|
+
}
|
|
102
|
+
export interface DmPermissions {
|
|
103
|
+
can_dm: boolean;
|
|
104
|
+
}
|
|
105
|
+
export interface Legacy {
|
|
106
|
+
default_profile: boolean;
|
|
107
|
+
default_profile_image: boolean;
|
|
108
|
+
description: string;
|
|
109
|
+
entities: Entities;
|
|
110
|
+
fast_followers_count: number;
|
|
111
|
+
favourites_count: number;
|
|
112
|
+
followers_count: number;
|
|
113
|
+
friends_count: number;
|
|
114
|
+
has_custom_timelines: boolean;
|
|
115
|
+
is_translator: boolean;
|
|
116
|
+
listed_count: number;
|
|
117
|
+
media_count: number;
|
|
118
|
+
needs_phone_verification: boolean;
|
|
119
|
+
normal_followers_count: number;
|
|
120
|
+
pinned_tweet_ids_str: any[];
|
|
121
|
+
possibly_sensitive: boolean;
|
|
122
|
+
profile_interstitial_type: string;
|
|
123
|
+
statuses_count: number;
|
|
124
|
+
translator_type: string;
|
|
125
|
+
want_retweets: boolean;
|
|
126
|
+
withheld_in_countries: any[];
|
|
127
|
+
}
|
|
128
|
+
export interface Entities {
|
|
129
|
+
description: Description;
|
|
130
|
+
}
|
|
131
|
+
export interface Description {
|
|
132
|
+
urls: any[];
|
|
133
|
+
}
|
|
134
|
+
export interface Location {
|
|
135
|
+
location: string;
|
|
136
|
+
}
|
|
137
|
+
export interface MediaPermissions {
|
|
138
|
+
can_media_tag: boolean;
|
|
139
|
+
}
|
|
140
|
+
export interface Privacy {
|
|
141
|
+
protected: boolean;
|
|
142
|
+
}
|
|
143
|
+
export interface RelationshipPerspectives {
|
|
144
|
+
following: boolean;
|
|
145
|
+
}
|
|
146
|
+
export interface TipjarSettings {
|
|
147
|
+
}
|
|
148
|
+
export interface Verification {
|
|
149
|
+
verified: boolean;
|
|
150
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"RemoveMember.js","sourceRoot":"","sources":["../../../../src/types/raw/list/RemoveMember.ts"],"names":[],"mappings":";AAAA,oBAAoB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Bookmark.js","sourceRoot":"","sources":["../../../../src/types/raw/tweet/Bookmark.ts"],"names":[],"mappings":";AAAA,oBAAoB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Unbookmark.js","sourceRoot":"","sources":["../../../../src/types/raw/tweet/Unbookmark.ts"],"names":[],"mappings":";AAAA,oBAAoB"}
|
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { IAnalytics } from '../base/Analytic';
|
|
1
2
|
/**
|
|
2
3
|
* The raw data received when fetching the analytic overview of the user.
|
|
3
4
|
*
|
|
@@ -7,26 +8,13 @@ export interface IUserAnalyticsResponse {
|
|
|
7
8
|
data: Data;
|
|
8
9
|
}
|
|
9
10
|
interface Data {
|
|
10
|
-
|
|
11
|
+
viewer_v2: ViewerV2;
|
|
11
12
|
}
|
|
12
|
-
interface
|
|
13
|
-
|
|
14
|
-
id: string;
|
|
13
|
+
interface ViewerV2 {
|
|
14
|
+
user_results: UserResults;
|
|
15
15
|
}
|
|
16
|
-
interface
|
|
17
|
-
__typename: string;
|
|
18
|
-
organic_metrics_time_series: Series[];
|
|
16
|
+
interface UserResults {
|
|
19
17
|
id: string;
|
|
20
|
-
|
|
21
|
-
interface Series {
|
|
22
|
-
metric_values: MetricValue[];
|
|
23
|
-
timestamp: Timestamp;
|
|
24
|
-
}
|
|
25
|
-
interface MetricValue {
|
|
26
|
-
metric_value: number;
|
|
27
|
-
metric_type: string;
|
|
28
|
-
}
|
|
29
|
-
interface Timestamp {
|
|
30
|
-
iso8601_time: string;
|
|
18
|
+
result: IAnalytics;
|
|
31
19
|
}
|
|
32
20
|
export {};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"Analytics.js","sourceRoot":"","sources":["../../../../src/types/raw/user/Analytics.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"Analytics.js","sourceRoot":"","sources":["../../../../src/types/raw/user/Analytics.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,319 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The raw data received when fetching the lists of the given user.
|
|
3
|
+
*
|
|
4
|
+
* @public
|
|
5
|
+
*/
|
|
6
|
+
export interface IUserListsResponse {
|
|
7
|
+
data: Data;
|
|
8
|
+
}
|
|
9
|
+
export interface Data {
|
|
10
|
+
viewer: Viewer;
|
|
11
|
+
}
|
|
12
|
+
export interface Viewer {
|
|
13
|
+
list_management_timeline: ListManagementTimeline;
|
|
14
|
+
}
|
|
15
|
+
export interface ListManagementTimeline {
|
|
16
|
+
timeline: Timeline;
|
|
17
|
+
}
|
|
18
|
+
export interface Timeline {
|
|
19
|
+
instructions: Instruction[];
|
|
20
|
+
metadata: Metadata;
|
|
21
|
+
}
|
|
22
|
+
export interface Instruction {
|
|
23
|
+
type: string;
|
|
24
|
+
direction?: string;
|
|
25
|
+
entries?: Entry[];
|
|
26
|
+
}
|
|
27
|
+
export interface Entry {
|
|
28
|
+
entryId: string;
|
|
29
|
+
sortIndex: string;
|
|
30
|
+
content: Content;
|
|
31
|
+
}
|
|
32
|
+
export interface Content {
|
|
33
|
+
entryType: string;
|
|
34
|
+
__typename: string;
|
|
35
|
+
items?: Item[];
|
|
36
|
+
displayType?: string;
|
|
37
|
+
header?: Header;
|
|
38
|
+
footer?: Footer;
|
|
39
|
+
clientEventInfo?: ClientEventInfo2;
|
|
40
|
+
value?: string;
|
|
41
|
+
cursorType?: string;
|
|
42
|
+
}
|
|
43
|
+
export interface Item {
|
|
44
|
+
entryId: string;
|
|
45
|
+
item: Item2;
|
|
46
|
+
}
|
|
47
|
+
export interface Item2 {
|
|
48
|
+
itemContent: ItemContent;
|
|
49
|
+
clientEventInfo: ClientEventInfo;
|
|
50
|
+
}
|
|
51
|
+
export interface ItemContent {
|
|
52
|
+
itemType: string;
|
|
53
|
+
__typename: string;
|
|
54
|
+
displayType: string;
|
|
55
|
+
list: List;
|
|
56
|
+
}
|
|
57
|
+
export interface List {
|
|
58
|
+
created_at: number;
|
|
59
|
+
default_banner_media: DefaultBannerMedia;
|
|
60
|
+
default_banner_media_results: DefaultBannerMediaResults;
|
|
61
|
+
description: string;
|
|
62
|
+
facepile_urls: string[];
|
|
63
|
+
followers_context?: string;
|
|
64
|
+
following: boolean;
|
|
65
|
+
id: string;
|
|
66
|
+
id_str: string;
|
|
67
|
+
is_member: boolean;
|
|
68
|
+
member_count: number;
|
|
69
|
+
members_context?: string;
|
|
70
|
+
mode: string;
|
|
71
|
+
muting: boolean;
|
|
72
|
+
name: string;
|
|
73
|
+
pinning: boolean;
|
|
74
|
+
subscriber_count: number;
|
|
75
|
+
user_results: UserResults;
|
|
76
|
+
custom_banner_media?: CustomBannerMedia;
|
|
77
|
+
custom_banner_media_results?: CustomBannerMediaResults;
|
|
78
|
+
}
|
|
79
|
+
export interface DefaultBannerMedia {
|
|
80
|
+
media_info: MediaInfo;
|
|
81
|
+
}
|
|
82
|
+
export interface MediaInfo {
|
|
83
|
+
original_img_url: string;
|
|
84
|
+
original_img_width: number;
|
|
85
|
+
original_img_height: number;
|
|
86
|
+
salient_rect: SalientRect;
|
|
87
|
+
}
|
|
88
|
+
export interface SalientRect {
|
|
89
|
+
left: number;
|
|
90
|
+
top: number;
|
|
91
|
+
width: number;
|
|
92
|
+
height: number;
|
|
93
|
+
}
|
|
94
|
+
export interface DefaultBannerMediaResults {
|
|
95
|
+
result: Result;
|
|
96
|
+
}
|
|
97
|
+
export interface Result {
|
|
98
|
+
id: string;
|
|
99
|
+
media_key: string;
|
|
100
|
+
media_id: string;
|
|
101
|
+
media_info: MediaInfo2;
|
|
102
|
+
__typename: string;
|
|
103
|
+
}
|
|
104
|
+
export interface MediaInfo2 {
|
|
105
|
+
__typename: string;
|
|
106
|
+
original_img_height: number;
|
|
107
|
+
original_img_width: number;
|
|
108
|
+
original_img_url: string;
|
|
109
|
+
salient_rect: SalientRect2;
|
|
110
|
+
}
|
|
111
|
+
export interface SalientRect2 {
|
|
112
|
+
height: number;
|
|
113
|
+
left: number;
|
|
114
|
+
top: number;
|
|
115
|
+
width: number;
|
|
116
|
+
}
|
|
117
|
+
export interface UserResults {
|
|
118
|
+
result: Result2;
|
|
119
|
+
}
|
|
120
|
+
export interface Result2 {
|
|
121
|
+
__typename: string;
|
|
122
|
+
id: string;
|
|
123
|
+
rest_id: string;
|
|
124
|
+
affiliates_highlighted_label: AffiliatesHighlightedLabel;
|
|
125
|
+
avatar: Avatar;
|
|
126
|
+
core: Core;
|
|
127
|
+
dm_permissions: DmPermissions;
|
|
128
|
+
has_graduated_access: boolean;
|
|
129
|
+
is_blue_verified: boolean;
|
|
130
|
+
legacy: Legacy;
|
|
131
|
+
location: Location;
|
|
132
|
+
media_permissions: MediaPermissions;
|
|
133
|
+
parody_commentary_fan_label: string;
|
|
134
|
+
profile_image_shape: string;
|
|
135
|
+
professional?: Professional;
|
|
136
|
+
privacy: Privacy;
|
|
137
|
+
relationship_perspectives: RelationshipPerspectives;
|
|
138
|
+
tipjar_settings: TipjarSettings;
|
|
139
|
+
verification: Verification;
|
|
140
|
+
verified_phone_status: boolean;
|
|
141
|
+
}
|
|
142
|
+
export interface AffiliatesHighlightedLabel {
|
|
143
|
+
}
|
|
144
|
+
export interface Avatar {
|
|
145
|
+
image_url: string;
|
|
146
|
+
}
|
|
147
|
+
export interface Core {
|
|
148
|
+
created_at: string;
|
|
149
|
+
name: string;
|
|
150
|
+
screen_name: string;
|
|
151
|
+
}
|
|
152
|
+
export interface DmPermissions {
|
|
153
|
+
can_dm: boolean;
|
|
154
|
+
}
|
|
155
|
+
export interface Legacy {
|
|
156
|
+
default_profile: boolean;
|
|
157
|
+
default_profile_image: boolean;
|
|
158
|
+
description: string;
|
|
159
|
+
entities: Entities;
|
|
160
|
+
fast_followers_count: number;
|
|
161
|
+
favourites_count: number;
|
|
162
|
+
followers_count: number;
|
|
163
|
+
friends_count: number;
|
|
164
|
+
has_custom_timelines: boolean;
|
|
165
|
+
is_translator: boolean;
|
|
166
|
+
listed_count: number;
|
|
167
|
+
media_count: number;
|
|
168
|
+
normal_followers_count: number;
|
|
169
|
+
pinned_tweet_ids_str: string[];
|
|
170
|
+
possibly_sensitive: boolean;
|
|
171
|
+
profile_banner_url?: string;
|
|
172
|
+
profile_interstitial_type: string;
|
|
173
|
+
statuses_count: number;
|
|
174
|
+
translator_type: string;
|
|
175
|
+
url?: string;
|
|
176
|
+
want_retweets: boolean;
|
|
177
|
+
withheld_in_countries: any[];
|
|
178
|
+
needs_phone_verification?: boolean;
|
|
179
|
+
}
|
|
180
|
+
export interface Entities {
|
|
181
|
+
description: Description;
|
|
182
|
+
url?: Url;
|
|
183
|
+
}
|
|
184
|
+
export interface Description {
|
|
185
|
+
urls: any[];
|
|
186
|
+
}
|
|
187
|
+
export interface Url {
|
|
188
|
+
urls: Url2[];
|
|
189
|
+
}
|
|
190
|
+
export interface Url2 {
|
|
191
|
+
display_url: string;
|
|
192
|
+
expanded_url: string;
|
|
193
|
+
url: string;
|
|
194
|
+
indices: number[];
|
|
195
|
+
}
|
|
196
|
+
export interface Location {
|
|
197
|
+
location: string;
|
|
198
|
+
}
|
|
199
|
+
export interface MediaPermissions {
|
|
200
|
+
can_media_tag: boolean;
|
|
201
|
+
}
|
|
202
|
+
export interface Professional {
|
|
203
|
+
rest_id: string;
|
|
204
|
+
professional_type: string;
|
|
205
|
+
category: Category[];
|
|
206
|
+
}
|
|
207
|
+
export interface Category {
|
|
208
|
+
id: number;
|
|
209
|
+
name: string;
|
|
210
|
+
icon_name: string;
|
|
211
|
+
}
|
|
212
|
+
export interface Privacy {
|
|
213
|
+
protected: boolean;
|
|
214
|
+
}
|
|
215
|
+
export interface RelationshipPerspectives {
|
|
216
|
+
following: boolean;
|
|
217
|
+
}
|
|
218
|
+
export interface TipjarSettings {
|
|
219
|
+
is_enabled?: boolean;
|
|
220
|
+
bitcoin_handle?: string;
|
|
221
|
+
ethereum_handle?: string;
|
|
222
|
+
}
|
|
223
|
+
export interface Verification {
|
|
224
|
+
verified: boolean;
|
|
225
|
+
}
|
|
226
|
+
export interface CustomBannerMedia {
|
|
227
|
+
media_info: MediaInfo3;
|
|
228
|
+
}
|
|
229
|
+
export interface MediaInfo3 {
|
|
230
|
+
original_img_url: string;
|
|
231
|
+
original_img_width: number;
|
|
232
|
+
original_img_height: number;
|
|
233
|
+
salient_rect: SalientRect3;
|
|
234
|
+
}
|
|
235
|
+
export interface SalientRect3 {
|
|
236
|
+
left: number;
|
|
237
|
+
top: number;
|
|
238
|
+
width: number;
|
|
239
|
+
height: number;
|
|
240
|
+
}
|
|
241
|
+
export interface CustomBannerMediaResults {
|
|
242
|
+
result: Result3;
|
|
243
|
+
}
|
|
244
|
+
export interface Result3 {
|
|
245
|
+
id: string;
|
|
246
|
+
media_key: string;
|
|
247
|
+
media_id: string;
|
|
248
|
+
media_info: MediaInfo4;
|
|
249
|
+
__typename: string;
|
|
250
|
+
}
|
|
251
|
+
export interface MediaInfo4 {
|
|
252
|
+
__typename: string;
|
|
253
|
+
original_img_height: number;
|
|
254
|
+
original_img_width: number;
|
|
255
|
+
original_img_url: string;
|
|
256
|
+
salient_rect: SalientRect4;
|
|
257
|
+
color_info: ColorInfo;
|
|
258
|
+
}
|
|
259
|
+
export interface SalientRect4 {
|
|
260
|
+
height: number;
|
|
261
|
+
left: number;
|
|
262
|
+
top: number;
|
|
263
|
+
width: number;
|
|
264
|
+
}
|
|
265
|
+
export interface ColorInfo {
|
|
266
|
+
palette: Palette[];
|
|
267
|
+
}
|
|
268
|
+
export interface Palette {
|
|
269
|
+
percentage: number;
|
|
270
|
+
rgb: Rgb;
|
|
271
|
+
}
|
|
272
|
+
export interface Rgb {
|
|
273
|
+
blue: number;
|
|
274
|
+
green: number;
|
|
275
|
+
red: number;
|
|
276
|
+
}
|
|
277
|
+
export interface ClientEventInfo {
|
|
278
|
+
component: string;
|
|
279
|
+
element: string;
|
|
280
|
+
details: Details;
|
|
281
|
+
}
|
|
282
|
+
export interface Details {
|
|
283
|
+
timelinesDetails: TimelinesDetails;
|
|
284
|
+
}
|
|
285
|
+
export interface TimelinesDetails {
|
|
286
|
+
injectionType: string;
|
|
287
|
+
controllerData?: string;
|
|
288
|
+
}
|
|
289
|
+
export interface Header {
|
|
290
|
+
displayType: string;
|
|
291
|
+
text: string;
|
|
292
|
+
sticky: boolean;
|
|
293
|
+
}
|
|
294
|
+
export interface Footer {
|
|
295
|
+
displayType: string;
|
|
296
|
+
text: string;
|
|
297
|
+
landingUrl: LandingUrl;
|
|
298
|
+
}
|
|
299
|
+
export interface LandingUrl {
|
|
300
|
+
url: string;
|
|
301
|
+
urlType: string;
|
|
302
|
+
}
|
|
303
|
+
export interface ClientEventInfo2 {
|
|
304
|
+
component: string;
|
|
305
|
+
details: Details2;
|
|
306
|
+
}
|
|
307
|
+
export interface Details2 {
|
|
308
|
+
timelinesDetails: TimelinesDetails2;
|
|
309
|
+
}
|
|
310
|
+
export interface TimelinesDetails2 {
|
|
311
|
+
injectionType: string;
|
|
312
|
+
controllerData?: string;
|
|
313
|
+
}
|
|
314
|
+
export interface Metadata {
|
|
315
|
+
scribeConfig: ScribeConfig;
|
|
316
|
+
}
|
|
317
|
+
export interface ScribeConfig {
|
|
318
|
+
page: string;
|
|
319
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"Lists.js","sourceRoot":"","sources":["../../../../src/types/raw/user/Lists.ts"],"names":[],"mappings":";AAAA,oBAAoB"}
|
package/eslint.config.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "rettiwt-api",
|
|
3
|
-
"version": "6.0
|
|
3
|
+
"version": "6.1.0",
|
|
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!",
|
|
@@ -11,9 +11,10 @@
|
|
|
11
11
|
"build": "tsc",
|
|
12
12
|
"prepare": "tsc",
|
|
13
13
|
"format": "prettier --write .",
|
|
14
|
+
"format:check": "prettier --check .",
|
|
14
15
|
"lint": "eslint --max-warnings 0 --fix .",
|
|
15
|
-
"
|
|
16
|
-
"
|
|
16
|
+
"lint:check": "eslint --max-warnings 0 .",
|
|
17
|
+
"docs": "typedoc --excludePrivate --excludeProtected --excludeInternal src/index.ts"
|
|
17
18
|
},
|
|
18
19
|
"repository": {
|
|
19
20
|
"type": "git",
|
|
@@ -29,7 +30,7 @@
|
|
|
29
30
|
},
|
|
30
31
|
"homepage": "https://rishikant181.github.io/Rettiwt-API/",
|
|
31
32
|
"engines": {
|
|
32
|
-
"node": "^22.
|
|
33
|
+
"node": "^22.21.0"
|
|
33
34
|
},
|
|
34
35
|
"devDependencies": {
|
|
35
36
|
"@types/cookiejar": "^2.1.5",
|
|
@@ -53,6 +54,10 @@
|
|
|
53
54
|
"https-proxy-agent": "^7.0.6",
|
|
54
55
|
"jsdom": "^27.2.0",
|
|
55
56
|
"node-html-parser": "^7.0.1",
|
|
56
|
-
"x-client-transaction-id
|
|
57
|
-
}
|
|
57
|
+
"x-client-transaction-id": "^0.1.8"
|
|
58
|
+
},
|
|
59
|
+
"workspaces": [
|
|
60
|
+
"playground",
|
|
61
|
+
"src"
|
|
62
|
+
]
|
|
58
63
|
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
ACCESS_TOKEN=""
|
|
@@ -0,0 +1,53 @@
|
|
|
1
|
+
# Rettiwt Playground
|
|
2
|
+
|
|
3
|
+
This playground is intended for developers to test and experiment with features from the Rettiwt-API package in a local development environment.
|
|
4
|
+
|
|
5
|
+
## Getting Started
|
|
6
|
+
|
|
7
|
+
### Prerequisites
|
|
8
|
+
|
|
9
|
+
- Node.js (v22 or higher recommended)
|
|
10
|
+
- npm (v7+ recommended for workspace support)
|
|
11
|
+
|
|
12
|
+
### Setup
|
|
13
|
+
|
|
14
|
+
1. **Install dependencies**
|
|
15
|
+
From the root of the monorepo, run:
|
|
16
|
+
|
|
17
|
+
```sh
|
|
18
|
+
npm install
|
|
19
|
+
```
|
|
20
|
+
|
|
21
|
+
This will install dependencies for all workspaces, including `playground` and `src`.
|
|
22
|
+
|
|
23
|
+
2. **Environment Variables**
|
|
24
|
+
Create a `.env` file in the `playground` directory with your API credentials:
|
|
25
|
+
```env
|
|
26
|
+
ACCESS_TOKEN=your_access_token_here
|
|
27
|
+
```
|
|
28
|
+
|
|
29
|
+
### Usage
|
|
30
|
+
|
|
31
|
+
- The main entry point is [`index.js`](./index.js), which demonstrates usage of the Rettiwt-API.
|
|
32
|
+
- To run the playground:
|
|
33
|
+
```sh
|
|
34
|
+
npm start --workspace=playground
|
|
35
|
+
```
|
|
36
|
+
or from the `playground` directory:
|
|
37
|
+
```sh
|
|
38
|
+
npm start
|
|
39
|
+
```
|
|
40
|
+
|
|
41
|
+
### Modifying Playground Code
|
|
42
|
+
|
|
43
|
+
- Edit `index.js` to try different API features or test new functionality.
|
|
44
|
+
- The `rettiwt-api` dependency is linked via npm workspaces, so changes in `src` are immediately available in the playground after rebuilding if necessary.
|
|
45
|
+
|
|
46
|
+
## Notes
|
|
47
|
+
|
|
48
|
+
- This playground is for development and testing only. Do not use production credentials.
|
|
49
|
+
- For more advanced usage, add scripts or files as needed.
|
|
50
|
+
|
|
51
|
+
---
|
|
52
|
+
|
|
53
|
+
For questions or issues, see the main project README or open an issue.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Rettiwt } from 'rettiwt-api';
|
|
2
|
+
import 'dotenv/config';
|
|
3
|
+
|
|
4
|
+
const rettiwt = new Rettiwt({ apiKey: process.env.ACCESS_TOKEN });
|
|
5
|
+
|
|
6
|
+
async function userDetails() {
|
|
7
|
+
try {
|
|
8
|
+
const user = await rettiwt.user.details();
|
|
9
|
+
console.log(user);
|
|
10
|
+
} catch (error) {
|
|
11
|
+
console.error('Error fetching user details:', error);
|
|
12
|
+
}
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
await userDetails();
|