twitterapi-io-client 1.0.1 → 1.0.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/README.md +4 -0
- package/dist/resources/users.js +4 -4
- package/dist/types/communities.d.ts +5 -5
- package/dist/types/list.d.ts +2 -2
- package/dist/types/spaces.d.ts +1 -1
- package/dist/types/trends.d.ts +1 -1
- package/dist/types/tweets.d.ts +7 -7
- package/dist/types/users.d.ts +8 -8
- package/package.json +11 -4
package/README.md
CHANGED
|
@@ -10,12 +10,16 @@ npm install twitterapi-io-client
|
|
|
10
10
|
|
|
11
11
|
## Usage
|
|
12
12
|
|
|
13
|
+
### Setup
|
|
14
|
+
|
|
13
15
|
```typescript
|
|
14
16
|
import { TwitterAPIIOClient } from 'twitterapi-io-client';
|
|
15
17
|
|
|
16
18
|
const client = new TwitterAPIIOClient({
|
|
17
19
|
apiKey: 'your-api-key'
|
|
18
20
|
});
|
|
21
|
+
|
|
22
|
+
const accountInfo = await client.getUserProfileAbout("jorvixsky")
|
|
19
23
|
```
|
|
20
24
|
|
|
21
25
|
## Supported Endpoints
|
package/dist/resources/users.js
CHANGED
|
@@ -50,7 +50,7 @@ class UsersApi {
|
|
|
50
50
|
has_next_page: data.has_next_page ?? false,
|
|
51
51
|
next_cursor: data.next_cursor ?? "",
|
|
52
52
|
status: data.status || response.status || "success",
|
|
53
|
-
|
|
53
|
+
msg: data.msg || response.msg
|
|
54
54
|
};
|
|
55
55
|
}
|
|
56
56
|
// If data doesn't have tweets, return empty structure (API might be returning wrong data)
|
|
@@ -59,7 +59,7 @@ class UsersApi {
|
|
|
59
59
|
has_next_page: false,
|
|
60
60
|
next_cursor: "",
|
|
61
61
|
status: response.status || "success",
|
|
62
|
-
|
|
62
|
+
msg: response.msg
|
|
63
63
|
};
|
|
64
64
|
}
|
|
65
65
|
return response;
|
|
@@ -99,7 +99,7 @@ class UsersApi {
|
|
|
99
99
|
has_next_page: data.has_next_page ?? false,
|
|
100
100
|
next_cursor: data.next_cursor ?? "",
|
|
101
101
|
status: data.status || response.status || "success",
|
|
102
|
-
|
|
102
|
+
msg: data.msg || response.msg
|
|
103
103
|
};
|
|
104
104
|
}
|
|
105
105
|
// If data doesn't have tweets, return empty structure
|
|
@@ -108,7 +108,7 @@ class UsersApi {
|
|
|
108
108
|
has_next_page: false,
|
|
109
109
|
next_cursor: "",
|
|
110
110
|
status: response.status || "success",
|
|
111
|
-
|
|
111
|
+
msg: response.msg
|
|
112
112
|
};
|
|
113
113
|
}
|
|
114
114
|
return response;
|
|
@@ -11,33 +11,33 @@ export interface CommunityInfoResponse {
|
|
|
11
11
|
banner_image?: string;
|
|
12
12
|
profile_image?: string;
|
|
13
13
|
status: string;
|
|
14
|
-
|
|
14
|
+
msg: string;
|
|
15
15
|
}
|
|
16
16
|
export interface CommunityMembersResponse {
|
|
17
17
|
members: UserInfoResponse[];
|
|
18
18
|
has_next_page: boolean;
|
|
19
19
|
next_cursor: string;
|
|
20
20
|
status: string;
|
|
21
|
-
msg
|
|
21
|
+
msg: string;
|
|
22
22
|
}
|
|
23
23
|
export interface CommunityModeratorsResponse {
|
|
24
24
|
moderators: UserInfoResponse[];
|
|
25
25
|
has_next_page: boolean;
|
|
26
26
|
next_cursor: string;
|
|
27
27
|
status: string;
|
|
28
|
-
msg
|
|
28
|
+
msg: string;
|
|
29
29
|
}
|
|
30
30
|
export interface CommunityTweetsResponse {
|
|
31
31
|
tweets: Tweet[];
|
|
32
32
|
has_next_page: boolean;
|
|
33
33
|
next_cursor: string;
|
|
34
34
|
status: string;
|
|
35
|
-
|
|
35
|
+
msg: string;
|
|
36
36
|
}
|
|
37
37
|
export interface CommunitySearchResponse {
|
|
38
38
|
tweets: Tweet[];
|
|
39
39
|
has_next_page: boolean;
|
|
40
40
|
next_cursor: string;
|
|
41
41
|
status: string;
|
|
42
|
-
|
|
42
|
+
msg: string;
|
|
43
43
|
}
|
package/dist/types/list.d.ts
CHANGED
|
@@ -4,12 +4,12 @@ export interface ListFollowersResponse {
|
|
|
4
4
|
has_next_page: boolean;
|
|
5
5
|
next_cursor: string;
|
|
6
6
|
status: string;
|
|
7
|
-
msg
|
|
7
|
+
msg: string;
|
|
8
8
|
}
|
|
9
9
|
export interface ListMembersResponse {
|
|
10
10
|
members: UserInfoResponse[];
|
|
11
11
|
has_next_page: boolean;
|
|
12
12
|
next_cursor: string;
|
|
13
13
|
status: string;
|
|
14
|
-
msg
|
|
14
|
+
msg: string;
|
|
15
15
|
}
|
package/dist/types/spaces.d.ts
CHANGED
package/dist/types/trends.d.ts
CHANGED
package/dist/types/tweets.d.ts
CHANGED
|
@@ -44,33 +44,33 @@ export interface Tweet {
|
|
|
44
44
|
export interface TweetsByIdsResponse {
|
|
45
45
|
tweets: Tweet[];
|
|
46
46
|
status: string;
|
|
47
|
-
|
|
47
|
+
msg: string;
|
|
48
48
|
}
|
|
49
49
|
export interface TweetRepliesResponse {
|
|
50
50
|
tweets: Tweet[];
|
|
51
51
|
has_next_page: boolean;
|
|
52
52
|
next_cursor: string;
|
|
53
53
|
status: string;
|
|
54
|
-
|
|
54
|
+
msg: string;
|
|
55
55
|
}
|
|
56
56
|
export interface TweetQuotationsResponse {
|
|
57
57
|
tweets: Tweet[];
|
|
58
58
|
has_next_page: boolean;
|
|
59
59
|
next_cursor: string;
|
|
60
60
|
status: string;
|
|
61
|
-
|
|
61
|
+
msg: string;
|
|
62
62
|
}
|
|
63
63
|
export interface TweetRetweetersResponse {
|
|
64
64
|
retweeters: UserInfoResponse[];
|
|
65
65
|
has_next_page: boolean;
|
|
66
66
|
next_cursor: string;
|
|
67
67
|
status: string;
|
|
68
|
-
|
|
68
|
+
msg: string;
|
|
69
69
|
}
|
|
70
70
|
export interface TweetThreadContextResponse {
|
|
71
71
|
tweets: Tweet[];
|
|
72
72
|
status: string;
|
|
73
|
-
|
|
73
|
+
msg: string;
|
|
74
74
|
}
|
|
75
75
|
export interface ArticleResponse {
|
|
76
76
|
article: {
|
|
@@ -83,12 +83,12 @@ export interface ArticleResponse {
|
|
|
83
83
|
content?: string;
|
|
84
84
|
};
|
|
85
85
|
status: string;
|
|
86
|
-
|
|
86
|
+
msg: string;
|
|
87
87
|
}
|
|
88
88
|
export interface SearchTweetsResponse {
|
|
89
89
|
tweets: Tweet[];
|
|
90
90
|
has_next_page: boolean;
|
|
91
91
|
next_cursor: string;
|
|
92
92
|
status: string;
|
|
93
|
-
|
|
93
|
+
msg: string;
|
|
94
94
|
}
|
package/dist/types/users.d.ts
CHANGED
|
@@ -27,7 +27,7 @@ export interface UserInfoResponse {
|
|
|
27
27
|
isAutomated: boolean;
|
|
28
28
|
automatedBy: string;
|
|
29
29
|
unavailable?: boolean;
|
|
30
|
-
|
|
30
|
+
msg: string;
|
|
31
31
|
unavailableReason?: string;
|
|
32
32
|
profile_bio: {
|
|
33
33
|
description: string;
|
|
@@ -56,14 +56,14 @@ export interface UserFollowersResponse {
|
|
|
56
56
|
has_next_page: boolean;
|
|
57
57
|
next_cursor: string;
|
|
58
58
|
status: string;
|
|
59
|
-
|
|
59
|
+
msg: string;
|
|
60
60
|
}
|
|
61
61
|
export interface UserFollowingsResponse {
|
|
62
62
|
followings: UserInfoResponse[];
|
|
63
63
|
has_next_page: boolean;
|
|
64
64
|
next_cursor: string;
|
|
65
65
|
status: string;
|
|
66
|
-
|
|
66
|
+
msg: string;
|
|
67
67
|
}
|
|
68
68
|
export interface UserProfileAboutResponse {
|
|
69
69
|
data: {
|
|
@@ -118,14 +118,14 @@ export interface UserLatestTweetsResponse {
|
|
|
118
118
|
has_next_page: boolean;
|
|
119
119
|
next_cursor: string;
|
|
120
120
|
status: string;
|
|
121
|
-
|
|
121
|
+
msg: string;
|
|
122
122
|
}
|
|
123
123
|
export interface UserMentionsResponse {
|
|
124
124
|
tweets: Tweet[];
|
|
125
125
|
has_next_page: boolean;
|
|
126
126
|
next_cursor: string;
|
|
127
127
|
status: string;
|
|
128
|
-
|
|
128
|
+
msg: string;
|
|
129
129
|
}
|
|
130
130
|
export interface FollowRelationshipResponse {
|
|
131
131
|
data: {
|
|
@@ -133,19 +133,19 @@ export interface FollowRelationshipResponse {
|
|
|
133
133
|
followed_by: boolean;
|
|
134
134
|
};
|
|
135
135
|
status: string;
|
|
136
|
-
|
|
136
|
+
msg: string;
|
|
137
137
|
}
|
|
138
138
|
export interface SearchUserByKeywordResponse {
|
|
139
139
|
users: UserInfoResponse[];
|
|
140
140
|
has_next_page: boolean;
|
|
141
141
|
next_cursor: string;
|
|
142
142
|
status: string;
|
|
143
|
-
msg
|
|
143
|
+
msg: string;
|
|
144
144
|
}
|
|
145
145
|
export interface UserVerifiedFollowersResponse {
|
|
146
146
|
followers: UserInfoResponse[];
|
|
147
147
|
status: string;
|
|
148
|
-
|
|
148
|
+
msg: string;
|
|
149
149
|
}
|
|
150
150
|
export interface BatchUserInfoByUserIdsResponse {
|
|
151
151
|
users: UserInfoResponse[];
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "twitterapi-io-client",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.2",
|
|
4
4
|
"description": "A TypeScript client library for the TwitterAPI.io API",
|
|
5
5
|
"author": "jorvixsky",
|
|
6
6
|
"license": "MIT",
|
|
@@ -22,7 +22,14 @@
|
|
|
22
22
|
"build": "tsc -p tsconfig.json",
|
|
23
23
|
"prepublishOnly": "npm run build && npm test",
|
|
24
24
|
"test": "vitest run",
|
|
25
|
-
"test:watch": "vitest"
|
|
25
|
+
"test:watch": "vitest",
|
|
26
|
+
"test:environment": "vitest run test/environment.test.ts",
|
|
27
|
+
"test:users": "vitest run test/users.test.ts",
|
|
28
|
+
"test:list": "vitest run test/list.test.ts",
|
|
29
|
+
"test:communities": "vitest run test/communities.test.ts",
|
|
30
|
+
"test:trends": "vitest run test/trends.test.ts",
|
|
31
|
+
"test:spaces": "vitest run test/spaces.test.ts",
|
|
32
|
+
"test:tweets": "vitest run test/tweets.test.ts"
|
|
26
33
|
},
|
|
27
34
|
"devDependencies": {
|
|
28
35
|
"@types/node": "24.10.0",
|
|
@@ -30,6 +37,6 @@
|
|
|
30
37
|
"vitest": "4.0.15"
|
|
31
38
|
},
|
|
32
39
|
"repository": {
|
|
33
|
-
"url": "https://github.com/jorvixsky/twitterapi-io-client"
|
|
40
|
+
"url": "git+https://github.com/jorvixsky/twitterapi-io-client.git"
|
|
34
41
|
}
|
|
35
|
-
}
|
|
42
|
+
}
|