twitterapi-io-client 1.0.2 → 1.0.3

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 CHANGED
@@ -86,6 +86,13 @@ const accountInfo = await client.getUserProfileAbout("jorvixsky")
86
86
  | Get Article | `GET /twitter/article` | ✅ Supported | `client.tweets.getArticle(articleId)` |
87
87
  | Advanced Search | `GET /twitter/search` | ✅ Supported | `client.tweets.searchTweets(query, queryType?, cursor?)` |
88
88
 
89
+ ### ✅ Stream Endpoint
90
+
91
+ | Endpoint | Method | Status | Notes |
92
+ |----------|--------|--------|-------|
93
+ | Add User to Monitor | `POST /oapi/x_user_stream/add_user_to_monitor_tweet` | ✅ Supported | `client.stream.addUserToMonitor(xUserName)` |
94
+ | Remove User from Monitor | `POST /oapi/x_user_stream/remove_user_from_monitor_tweet` | ✅ Supported | `client.stream.removeUserFromMonitor(xUserName)` |
95
+
89
96
  ## Not Supported Endpoints
90
97
 
91
98
  The following endpoint categories are **not yet implemented**:
@@ -115,11 +122,6 @@ The following endpoint categories are **not yet implemented**:
115
122
  - `POST /oapi/webhook/filter/update` - Update Webhook/Websocket Tweet Filter Rule
116
123
  - `DELETE /oapi/webhook/filter/delete` - Delete Webhook/Websocket Tweet Filter Rule
117
124
 
118
- ### ❌ Stream Endpoint
119
-
120
- - `POST /oapi/stream/add` - Add a twitter user to monitor his tweets
121
- - `POST /oapi/stream/remove` - Remove a user from monitor list
122
-
123
125
  ### ❌ Deprecated Endpoints
124
126
 
125
127
  The following endpoints are marked as deprecated in the API documentation and are not implemented:
@@ -136,8 +138,8 @@ The following endpoints are marked as deprecated in the API documentation and ar
136
138
 
137
139
  ## Implementation Status Summary
138
140
 
139
- - **Fully Supported**: 27 endpoints (10 User endpoints + 2 List endpoints + 1 My endpoint + 5 Communities endpoints + 1 Trend endpoint + 1 Spaces endpoint + 7 Tweet endpoints)
140
- - **Not Implemented**: ~16+ endpoints across multiple categories
141
+ - **Fully Supported**: 29 endpoints (10 User endpoints + 2 List endpoints + 1 My endpoint + 5 Communities endpoints + 1 Trend endpoint + 1 Spaces endpoint + 7 Tweet endpoints + 2 Stream endpoints)
142
+ - **Not Implemented**: ~14+ endpoints across multiple categories
141
143
 
142
144
  ## Contributing
143
145
 
@@ -147,3 +149,6 @@ Contributions are welcome! If you'd like to add support for additional endpoints
147
149
 
148
150
  For detailed API documentation, visit: [https://docs.twitterapi.io](https://docs.twitterapi.io)
149
151
 
152
+ ## Support the project
153
+
154
+ If you need to create your twitterapi-io account and you want to support this client to help me mantain it and make your implementation easier for you, you can do so by using this [affiliate link](https://twitterapi.io/?ref=jordi666).
package/dist/client.d.ts CHANGED
@@ -6,6 +6,7 @@ import { CommunitiesApi } from "./resources/communities";
6
6
  import { TrendsApi } from "./resources/trends";
7
7
  import { SpacesApi } from "./resources/spaces";
8
8
  import { TweetsApi } from "./resources/tweets";
9
+ import { StreamApi } from "./resources/stream";
9
10
  export interface TwitterAPIIOClientOptions extends HttpClientOptions {
10
11
  }
11
12
  export declare class TwitterAPIIOClient {
@@ -16,5 +17,6 @@ export declare class TwitterAPIIOClient {
16
17
  readonly trends: TrendsApi;
17
18
  readonly spaces: SpacesApi;
18
19
  readonly tweets: TweetsApi;
20
+ readonly stream: StreamApi;
19
21
  constructor(options: TwitterAPIIOClientOptions);
20
22
  }
package/dist/client.js CHANGED
@@ -9,6 +9,7 @@ const communities_1 = require("./resources/communities");
9
9
  const trends_1 = require("./resources/trends");
10
10
  const spaces_1 = require("./resources/spaces");
11
11
  const tweets_1 = require("./resources/tweets");
12
+ const stream_1 = require("./resources/stream");
12
13
  class TwitterAPIIOClient {
13
14
  users;
14
15
  myEndpoint;
@@ -17,6 +18,7 @@ class TwitterAPIIOClient {
17
18
  trends;
18
19
  spaces;
19
20
  tweets;
21
+ stream;
20
22
  constructor(options) {
21
23
  const http = new httpClient_1.HttpClient(options);
22
24
  this.users = new users_1.UsersApi(http);
@@ -26,6 +28,7 @@ class TwitterAPIIOClient {
26
28
  this.trends = new trends_1.TrendsApi(http);
27
29
  this.spaces = new spaces_1.SpacesApi(http);
28
30
  this.tweets = new tweets_1.TweetsApi(http);
31
+ this.stream = new stream_1.StreamApi(http);
29
32
  }
30
33
  }
31
34
  exports.TwitterAPIIOClient = TwitterAPIIOClient;
@@ -0,0 +1,8 @@
1
+ import type { HttpClient } from "../httpClient";
2
+ import type { StreamResponse } from "../types/stream";
3
+ export declare class StreamApi {
4
+ private http;
5
+ constructor(http: HttpClient);
6
+ addUserToMonitor(xUserName: string): Promise<StreamResponse>;
7
+ removeUserFromMonitor(xUserName: string): Promise<StreamResponse>;
8
+ }
@@ -0,0 +1,34 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.StreamApi = void 0;
4
+ class StreamApi {
5
+ http;
6
+ constructor(http) {
7
+ this.http = http;
8
+ }
9
+ async addUserToMonitor(xUserName) {
10
+ const body = {
11
+ x_user_name: xUserName,
12
+ };
13
+ return this.http.request("/oapi/x_user_stream/add_user_to_monitor_tweet", {
14
+ method: "POST",
15
+ headers: {
16
+ "Content-Type": "application/json",
17
+ },
18
+ body: JSON.stringify(body),
19
+ });
20
+ }
21
+ async removeUserFromMonitor(xUserName) {
22
+ const body = {
23
+ x_user_name: xUserName,
24
+ };
25
+ return this.http.request("/oapi/x_user_stream/remove_user_from_monitor_tweet", {
26
+ method: "POST",
27
+ headers: {
28
+ "Content-Type": "application/json",
29
+ },
30
+ body: JSON.stringify(body),
31
+ });
32
+ }
33
+ }
34
+ exports.StreamApi = StreamApi;
@@ -5,3 +5,4 @@ export * from "./spaces";
5
5
  export * from "./trends";
6
6
  export * from "./list";
7
7
  export * from "./myEndpoint";
8
+ export * from "./stream";
@@ -21,3 +21,4 @@ __exportStar(require("./spaces"), exports);
21
21
  __exportStar(require("./trends"), exports);
22
22
  __exportStar(require("./list"), exports);
23
23
  __exportStar(require("./myEndpoint"), exports);
24
+ __exportStar(require("./stream"), exports);
@@ -0,0 +1,10 @@
1
+ export interface AddUserToMonitorRequest {
2
+ x_user_name: string;
3
+ }
4
+ export interface RemoveUserFromMonitorRequest {
5
+ x_user_name: string;
6
+ }
7
+ export interface StreamResponse {
8
+ status: "success" | "error";
9
+ msg: string;
10
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "twitterapi-io-client",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "A TypeScript client library for the TwitterAPI.io API",
5
5
  "author": "jorvixsky",
6
6
  "license": "MIT",
@@ -29,7 +29,8 @@
29
29
  "test:communities": "vitest run test/communities.test.ts",
30
30
  "test:trends": "vitest run test/trends.test.ts",
31
31
  "test:spaces": "vitest run test/spaces.test.ts",
32
- "test:tweets": "vitest run test/tweets.test.ts"
32
+ "test:tweets": "vitest run test/tweets.test.ts",
33
+ "test:stream": "vitest run test/stream.test.ts"
33
34
  },
34
35
  "devDependencies": {
35
36
  "@types/node": "24.10.0",