x-twitter-scraper 0.2.1 → 0.3.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +36 -0
- package/README.md +51 -3
- package/client.d.mts +14 -27
- package/client.d.mts.map +1 -1
- package/client.d.ts +14 -27
- package/client.d.ts.map +1 -1
- package/client.js +12 -27
- package/client.js.map +1 -1
- package/client.mjs +12 -27
- package/client.mjs.map +1 -1
- package/internal/request-options.d.mts +0 -4
- package/internal/request-options.d.mts.map +1 -1
- package/internal/request-options.d.ts +0 -4
- package/internal/request-options.d.ts.map +1 -1
- package/internal/request-options.js.map +1 -1
- package/internal/request-options.mjs.map +1 -1
- package/internal/utils/env.js +2 -2
- package/internal/utils/env.js.map +1 -1
- package/internal/utils/env.mjs +2 -2
- package/internal/utils/env.mjs.map +1 -1
- package/package.json +31 -10
- package/resources/account.d.mts +7 -6
- package/resources/account.d.mts.map +1 -1
- package/resources/account.d.ts +7 -6
- package/resources/account.d.ts.map +1 -1
- package/resources/account.js +3 -3
- package/resources/account.js.map +1 -1
- package/resources/account.mjs +3 -3
- package/resources/account.mjs.map +1 -1
- package/resources/api-keys.js +3 -3
- package/resources/api-keys.js.map +1 -1
- package/resources/api-keys.mjs +3 -3
- package/resources/api-keys.mjs.map +1 -1
- package/resources/compose.d.mts +1 -1
- package/resources/compose.d.ts +1 -1
- package/resources/compose.js +1 -1
- package/resources/compose.mjs +1 -1
- package/resources/credits.d.mts +1 -1
- package/resources/credits.d.ts +1 -1
- package/resources/credits.js +1 -1
- package/resources/credits.mjs +1 -1
- package/resources/drafts.d.mts +1 -1
- package/resources/drafts.d.ts +1 -1
- package/resources/drafts.js +1 -1
- package/resources/drafts.mjs +1 -1
- package/resources/events.js +1 -1
- package/resources/events.js.map +1 -1
- package/resources/events.mjs +1 -1
- package/resources/events.mjs.map +1 -1
- package/resources/extractions.d.mts +3 -2
- package/resources/extractions.d.mts.map +1 -1
- package/resources/extractions.d.ts +3 -2
- package/resources/extractions.d.ts.map +1 -1
- package/resources/index.d.mts +1 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +1 -5
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +0 -2
- package/resources/index.mjs.map +1 -1
- package/resources/monitors.d.mts +1 -1
- package/resources/monitors.d.ts +1 -1
- package/resources/monitors.js +1 -1
- package/resources/monitors.mjs +1 -1
- package/resources/radar.d.mts +45 -10
- package/resources/radar.d.mts.map +1 -1
- package/resources/radar.d.ts +45 -10
- package/resources/radar.d.ts.map +1 -1
- package/resources/radar.js +1 -1
- package/resources/radar.mjs +1 -1
- package/resources/shared.d.mts +47 -6
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +47 -6
- package/resources/shared.d.ts.map +1 -1
- package/resources/styles.d.mts +1 -1
- package/resources/styles.d.ts +1 -1
- package/resources/styles.js +1 -1
- package/resources/styles.mjs +1 -1
- package/resources/subscribe.d.mts +1 -1
- package/resources/subscribe.d.ts +1 -1
- package/resources/subscribe.js +1 -1
- package/resources/subscribe.mjs +1 -1
- package/resources/trends.d.mts +2 -2
- package/resources/trends.d.ts +2 -2
- package/resources/trends.js +2 -2
- package/resources/trends.mjs +2 -2
- package/resources/webhooks.d.mts +2 -2
- package/resources/webhooks.d.ts +2 -2
- package/resources/webhooks.js +2 -2
- package/resources/webhooks.mjs +2 -2
- package/resources/x/accounts.d.mts +48 -0
- package/resources/x/accounts.d.mts.map +1 -1
- package/resources/x/accounts.d.ts +48 -0
- package/resources/x/accounts.d.ts.map +1 -1
- package/resources/x/accounts.js +6 -10
- package/resources/x/accounts.js.map +1 -1
- package/resources/x/accounts.mjs +6 -10
- package/resources/x/accounts.mjs.map +1 -1
- package/resources/x/bookmarks.d.mts +1 -1
- package/resources/x/bookmarks.d.ts +1 -1
- package/resources/x/bookmarks.js +1 -1
- package/resources/x/bookmarks.mjs +1 -1
- package/resources/x/communities/communities.d.mts +4 -4
- package/resources/x/communities/communities.d.ts +4 -4
- package/resources/x/communities/communities.js +4 -4
- package/resources/x/communities/communities.mjs +4 -4
- package/resources/x/communities/tweets.d.mts +3 -3
- package/resources/x/communities/tweets.d.ts +3 -3
- package/resources/x/communities/tweets.js +3 -3
- package/resources/x/communities/tweets.mjs +3 -3
- package/resources/x/followers.d.mts +2 -2
- package/resources/x/followers.d.ts +2 -2
- package/resources/x/followers.js +2 -2
- package/resources/x/followers.mjs +2 -2
- package/resources/x/index.d.mts +3 -3
- package/resources/x/index.d.mts.map +1 -1
- package/resources/x/index.d.ts +3 -3
- package/resources/x/index.d.ts.map +1 -1
- package/resources/x/index.js.map +1 -1
- package/resources/x/index.mjs.map +1 -1
- package/resources/x/lists.d.mts +4 -4
- package/resources/x/lists.d.ts +4 -4
- package/resources/x/lists.js +4 -4
- package/resources/x/lists.mjs +4 -4
- package/resources/x/media.d.mts +2 -2
- package/resources/x/media.d.ts +2 -2
- package/resources/x/media.js +2 -2
- package/resources/x/media.mjs +2 -2
- package/resources/x/tweets/index.d.mts +1 -1
- package/resources/x/tweets/index.d.mts.map +1 -1
- package/resources/x/tweets/index.d.ts +1 -1
- package/resources/x/tweets/index.d.ts.map +1 -1
- package/resources/x/tweets/index.js.map +1 -1
- package/resources/x/tweets/index.mjs.map +1 -1
- package/resources/x/tweets/tweets.d.mts +19 -36
- package/resources/x/tweets/tweets.d.mts.map +1 -1
- package/resources/x/tweets/tweets.d.ts +19 -36
- package/resources/x/tweets/tweets.d.ts.map +1 -1
- package/resources/x/tweets/tweets.js +7 -7
- package/resources/x/tweets/tweets.js.map +1 -1
- package/resources/x/tweets/tweets.mjs +7 -7
- package/resources/x/tweets/tweets.mjs.map +1 -1
- package/resources/x/users/index.d.mts +1 -1
- package/resources/x/users/index.d.mts.map +1 -1
- package/resources/x/users/index.d.ts +1 -1
- package/resources/x/users/index.d.ts.map +1 -1
- package/resources/x/users/index.js.map +1 -1
- package/resources/x/users/index.mjs.map +1 -1
- package/resources/x/users/users.d.mts +13 -29
- package/resources/x/users/users.d.mts.map +1 -1
- package/resources/x/users/users.d.ts +13 -29
- package/resources/x/users/users.d.ts.map +1 -1
- package/resources/x/users/users.js +11 -11
- package/resources/x/users/users.js.map +1 -1
- package/resources/x/users/users.mjs +11 -11
- package/resources/x/users/users.mjs.map +1 -1
- package/resources/x/x.d.mts +17 -10
- package/resources/x/x.d.mts.map +1 -1
- package/resources/x/x.d.ts +17 -10
- package/resources/x/x.d.ts.map +1 -1
- package/resources/x/x.js +3 -6
- package/resources/x/x.js.map +1 -1
- package/resources/x/x.mjs +3 -6
- package/resources/x/x.mjs.map +1 -1
- package/src/client.ts +16 -56
- package/src/internal/request-options.ts +0 -2
- package/src/internal/utils/env.ts +2 -2
- package/src/resources/account.ts +10 -8
- package/src/resources/api-keys.ts +3 -3
- package/src/resources/compose.ts +1 -1
- package/src/resources/credits.ts +1 -1
- package/src/resources/drafts.ts +1 -1
- package/src/resources/events.ts +1 -1
- package/src/resources/extractions.ts +5 -3
- package/src/resources/index.ts +1 -13
- package/src/resources/monitors.ts +1 -1
- package/src/resources/radar.ts +50 -10
- package/src/resources/shared.ts +74 -14
- package/src/resources/styles.ts +1 -1
- package/src/resources/subscribe.ts +1 -1
- package/src/resources/trends.ts +2 -2
- package/src/resources/webhooks.ts +2 -2
- package/src/resources/x/accounts.ts +65 -10
- package/src/resources/x/bookmarks.ts +1 -1
- package/src/resources/x/communities/communities.ts +4 -4
- package/src/resources/x/communities/tweets.ts +3 -3
- package/src/resources/x/followers.ts +2 -2
- package/src/resources/x/index.ts +1 -2
- package/src/resources/x/lists.ts +4 -4
- package/src/resources/x/media.ts +2 -2
- package/src/resources/x/tweets/index.ts +0 -1
- package/src/resources/x/tweets/tweets.ts +20 -52
- package/src/resources/x/users/index.ts +0 -1
- package/src/resources/x/users/users.ts +12 -40
- package/src/resources/x/x.ts +19 -10
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
package/src/resources/index.ts
CHANGED
|
@@ -17,7 +17,6 @@ export {
|
|
|
17
17
|
type AccountSetXUsernameParams,
|
|
18
18
|
type AccountUpdateLocaleParams,
|
|
19
19
|
} from './account';
|
|
20
|
-
export { Bot } from './bot/bot';
|
|
21
20
|
export { Compose, type ComposeCreateResponse, type ComposeCreateParams } from './compose';
|
|
22
21
|
export {
|
|
23
22
|
Credits,
|
|
@@ -59,18 +58,6 @@ export {
|
|
|
59
58
|
type ExtractionExportResultsParams,
|
|
60
59
|
type ExtractionRunParams,
|
|
61
60
|
} from './extractions';
|
|
62
|
-
export {
|
|
63
|
-
Integrations,
|
|
64
|
-
type Integration,
|
|
65
|
-
type IntegrationDelivery,
|
|
66
|
-
type IntegrationListResponse,
|
|
67
|
-
type IntegrationDeleteResponse,
|
|
68
|
-
type IntegrationListDeliveriesResponse,
|
|
69
|
-
type IntegrationSendTestResponse,
|
|
70
|
-
type IntegrationCreateParams,
|
|
71
|
-
type IntegrationUpdateParams,
|
|
72
|
-
type IntegrationListDeliveriesParams,
|
|
73
|
-
} from './integrations';
|
|
74
61
|
export {
|
|
75
62
|
Monitors,
|
|
76
63
|
type Monitor,
|
|
@@ -119,4 +106,5 @@ export {
|
|
|
119
106
|
type XGetTrendsResponse,
|
|
120
107
|
type XGetHomeTimelineParams,
|
|
121
108
|
type XGetNotificationsParams,
|
|
109
|
+
type XGetTrendsParams,
|
|
122
110
|
} from './x/x';
|
|
@@ -16,7 +16,7 @@ export class Monitors extends APIResource {
|
|
|
16
16
|
* @example
|
|
17
17
|
* ```ts
|
|
18
18
|
* const monitor = await client.monitors.create({
|
|
19
|
-
* eventTypes: ['tweet.new', '
|
|
19
|
+
* eventTypes: ['tweet.new', 'tweet.reply'],
|
|
20
20
|
* username: 'elonmusk',
|
|
21
21
|
* });
|
|
22
22
|
* ```
|
package/src/resources/radar.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { APIPromise } from '../core/api-promise';
|
|
|
5
5
|
import { RequestOptions } from '../internal/request-options';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* AI tweet composition, drafts, writing styles, and radar
|
|
9
9
|
*/
|
|
10
10
|
export class Radar extends APIResource {
|
|
11
11
|
/**
|
|
@@ -20,10 +20,35 @@ export class Radar extends APIResource {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
|
-
* Trending topic with score, category, source, and
|
|
23
|
+
* Trending topic with score, category, source, region, language, and
|
|
24
|
+
* source-specific metadata.
|
|
24
25
|
*/
|
|
25
26
|
export interface RadarItem {
|
|
26
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Internal numeric identifier (stringified bigint).
|
|
29
|
+
*/
|
|
30
|
+
id: string;
|
|
31
|
+
|
|
32
|
+
category: 'general' | 'tech' | 'dev' | 'science' | 'culture' | 'politics' | 'business' | 'entertainment';
|
|
33
|
+
|
|
34
|
+
createdAt: string;
|
|
35
|
+
|
|
36
|
+
language: string;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Source-specific fields. Shape varies per source:
|
|
40
|
+
*
|
|
41
|
+
* - reddit: { subreddit: string, author: string }
|
|
42
|
+
* - github: { starsToday: number }
|
|
43
|
+
* - hacker_news: { points: number, numberComments: number }
|
|
44
|
+
* - google_trends: { approxTraffic: number }
|
|
45
|
+
* - polymarket: { volume24hr: number }
|
|
46
|
+
* - wikipedia: { views: number }
|
|
47
|
+
* - trustmrr: { mrr, growthPercent, last30Days, total, customers,
|
|
48
|
+
* activeSubscriptions, onSale, xHandle?, category?, askingPrice?, country?,
|
|
49
|
+
* growthMrrPercent?, multiple?, paymentProvider?, rank? }
|
|
50
|
+
*/
|
|
51
|
+
metadata: { [key: string]: unknown };
|
|
27
52
|
|
|
28
53
|
publishedAt: string;
|
|
29
54
|
|
|
@@ -31,7 +56,12 @@ export interface RadarItem {
|
|
|
31
56
|
|
|
32
57
|
score: number;
|
|
33
58
|
|
|
34
|
-
source:
|
|
59
|
+
source: 'github' | 'google_trends' | 'hacker_news' | 'polymarket' | 'reddit' | 'trustmrr' | 'wikipedia';
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Source-specific identifier used for deduplication.
|
|
63
|
+
*/
|
|
64
|
+
sourceId: string;
|
|
35
65
|
|
|
36
66
|
title: string;
|
|
37
67
|
|
|
@@ -43,27 +73,37 @@ export interface RadarItem {
|
|
|
43
73
|
}
|
|
44
74
|
|
|
45
75
|
export interface RadarRetrieveTrendingTopicsResponse {
|
|
76
|
+
hasMore: boolean;
|
|
77
|
+
|
|
46
78
|
items: Array<RadarItem>;
|
|
47
79
|
|
|
48
|
-
|
|
80
|
+
/**
|
|
81
|
+
* Opaque cursor for the next page (present only when hasMore is true).
|
|
82
|
+
*/
|
|
83
|
+
nextCursor?: string;
|
|
49
84
|
}
|
|
50
85
|
|
|
51
86
|
export interface RadarRetrieveTrendingTopicsParams {
|
|
52
87
|
/**
|
|
53
|
-
*
|
|
88
|
+
* Cursor for pagination (from prior response nextCursor).
|
|
54
89
|
*/
|
|
55
|
-
|
|
90
|
+
after?: string;
|
|
56
91
|
|
|
57
92
|
/**
|
|
58
|
-
*
|
|
93
|
+
* Filter by category.
|
|
59
94
|
*/
|
|
60
|
-
|
|
95
|
+
category?: 'general' | 'tech' | 'dev' | 'science' | 'culture' | 'politics' | 'business' | 'entertainment';
|
|
61
96
|
|
|
62
97
|
/**
|
|
63
|
-
* Lookback window in hours
|
|
98
|
+
* Lookback window in hours (1-168, default 24).
|
|
64
99
|
*/
|
|
65
100
|
hours?: number;
|
|
66
101
|
|
|
102
|
+
/**
|
|
103
|
+
* Number of items to return (1-100, default 50).
|
|
104
|
+
*/
|
|
105
|
+
limit?: number;
|
|
106
|
+
|
|
67
107
|
/**
|
|
68
108
|
* Region filter (us, global, etc.)
|
|
69
109
|
*/
|
package/src/resources/shared.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import * as TweetsAPI from './x/tweets/tweets';
|
|
4
|
-
import * as UsersAPI from './x/users/users';
|
|
5
|
-
|
|
6
3
|
/**
|
|
7
4
|
* Error response containing a machine-readable error code.
|
|
8
5
|
*/
|
|
@@ -17,17 +14,17 @@ export interface Error {
|
|
|
17
14
|
| 'invalid_tweet_id'
|
|
18
15
|
| 'invalid_tweet_url'
|
|
19
16
|
| 'invalid_username'
|
|
17
|
+
| 'insufficient_credits'
|
|
20
18
|
| 'missing_params'
|
|
21
19
|
| 'missing_query'
|
|
22
20
|
| 'monitor_already_exists'
|
|
23
21
|
| 'monitor_limit_reached'
|
|
22
|
+
| 'no_credits'
|
|
24
23
|
| 'no_subscription'
|
|
25
24
|
| 'not_found'
|
|
26
|
-
| 'stream_registration_failed'
|
|
27
25
|
| 'subscription_inactive'
|
|
28
26
|
| 'tweet_not_found'
|
|
29
27
|
| 'unauthenticated'
|
|
30
|
-
| 'usage_limit_reached'
|
|
31
28
|
| 'user_not_found'
|
|
32
29
|
| 'webhook_inactive'
|
|
33
30
|
| 'x_api_rate_limited'
|
|
@@ -38,13 +35,7 @@ export interface Error {
|
|
|
38
35
|
/**
|
|
39
36
|
* Type of monitor event fired when account activity occurs.
|
|
40
37
|
*/
|
|
41
|
-
export type EventType =
|
|
42
|
-
| 'tweet.new'
|
|
43
|
-
| 'tweet.reply'
|
|
44
|
-
| 'tweet.retweet'
|
|
45
|
-
| 'tweet.quote'
|
|
46
|
-
| 'follower.gained'
|
|
47
|
-
| 'follower.lost';
|
|
38
|
+
export type EventType = 'tweet.new' | 'tweet.reply' | 'tweet.retweet' | 'tweet.quote';
|
|
48
39
|
|
|
49
40
|
/**
|
|
50
41
|
* Paginated list of tweets with cursor-based navigation.
|
|
@@ -54,7 +45,7 @@ export interface PaginatedTweets {
|
|
|
54
45
|
|
|
55
46
|
next_cursor: string;
|
|
56
47
|
|
|
57
|
-
tweets: Array<
|
|
48
|
+
tweets: Array<SearchTweet>;
|
|
58
49
|
}
|
|
59
50
|
|
|
60
51
|
/**
|
|
@@ -65,5 +56,74 @@ export interface PaginatedUsers {
|
|
|
65
56
|
|
|
66
57
|
next_cursor: string;
|
|
67
58
|
|
|
68
|
-
users: Array<
|
|
59
|
+
users: Array<UserProfile>;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Tweet returned from search results with inline author info.
|
|
64
|
+
*/
|
|
65
|
+
export interface SearchTweet {
|
|
66
|
+
id: string;
|
|
67
|
+
|
|
68
|
+
text: string;
|
|
69
|
+
|
|
70
|
+
author?: SearchTweet.Author;
|
|
71
|
+
|
|
72
|
+
bookmarkCount?: number;
|
|
73
|
+
|
|
74
|
+
createdAt?: string;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* True for Note Tweets (long-form content, up to 25,000 characters)
|
|
78
|
+
*/
|
|
79
|
+
isNoteTweet?: boolean;
|
|
80
|
+
|
|
81
|
+
likeCount?: number;
|
|
82
|
+
|
|
83
|
+
quoteCount?: number;
|
|
84
|
+
|
|
85
|
+
replyCount?: number;
|
|
86
|
+
|
|
87
|
+
retweetCount?: number;
|
|
88
|
+
|
|
89
|
+
viewCount?: number;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export namespace SearchTweet {
|
|
93
|
+
export interface Author {
|
|
94
|
+
id: string;
|
|
95
|
+
|
|
96
|
+
name: string;
|
|
97
|
+
|
|
98
|
+
username: string;
|
|
99
|
+
|
|
100
|
+
verified?: boolean;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* X user profile with bio, follower counts, and verification status.
|
|
106
|
+
*/
|
|
107
|
+
export interface UserProfile {
|
|
108
|
+
id: string;
|
|
109
|
+
|
|
110
|
+
name: string;
|
|
111
|
+
|
|
112
|
+
username: string;
|
|
113
|
+
|
|
114
|
+
createdAt?: string;
|
|
115
|
+
|
|
116
|
+
description?: string;
|
|
117
|
+
|
|
118
|
+
followers?: number;
|
|
119
|
+
|
|
120
|
+
following?: number;
|
|
121
|
+
|
|
122
|
+
location?: string;
|
|
123
|
+
|
|
124
|
+
profilePicture?: string;
|
|
125
|
+
|
|
126
|
+
statusesCount?: number;
|
|
127
|
+
|
|
128
|
+
verified?: boolean;
|
|
69
129
|
}
|
package/src/resources/styles.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { RequestOptions } from '../internal/request-options';
|
|
|
7
7
|
import { path } from '../internal/utils/path';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* AI tweet composition, drafts, writing styles, and radar
|
|
11
11
|
*/
|
|
12
12
|
export class Styles extends APIResource {
|
|
13
13
|
/**
|
package/src/resources/trends.ts
CHANGED
|
@@ -5,11 +5,11 @@ import { APIPromise } from '../core/api-promise';
|
|
|
5
5
|
import { RequestOptions } from '../internal/request-options';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* Trending topics by region
|
|
8
|
+
* Trending topics and hashtags by region
|
|
9
9
|
*/
|
|
10
10
|
export class Trends extends APIResource {
|
|
11
11
|
/**
|
|
12
|
-
* Get
|
|
12
|
+
* Get trending hashtags and topics by region (alias)
|
|
13
13
|
*/
|
|
14
14
|
list(
|
|
15
15
|
query: TrendListParams | null | undefined = {},
|
|
@@ -7,7 +7,7 @@ import { RequestOptions } from '../internal/request-options';
|
|
|
7
7
|
import { path } from '../internal/utils/path';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* Webhook endpoint management
|
|
10
|
+
* Webhook endpoint management and delivery
|
|
11
11
|
*/
|
|
12
12
|
export class Webhooks extends APIResource {
|
|
13
13
|
/**
|
|
@@ -16,7 +16,7 @@ export class Webhooks extends APIResource {
|
|
|
16
16
|
* @example
|
|
17
17
|
* ```ts
|
|
18
18
|
* const webhook = await client.webhooks.create({
|
|
19
|
-
* eventTypes: ['tweet.new', '
|
|
19
|
+
* eventTypes: ['tweet.new', 'tweet.reply'],
|
|
20
20
|
* url: 'https://example.com/webhook',
|
|
21
21
|
* });
|
|
22
22
|
* ```
|
|
@@ -22,7 +22,7 @@ export class Accounts extends APIResource {
|
|
|
22
22
|
* ```
|
|
23
23
|
*/
|
|
24
24
|
create(body: AccountCreateParams, options?: RequestOptions): APIPromise<AccountCreateResponse> {
|
|
25
|
-
return this._client.post('/x/accounts', { body, ...options
|
|
25
|
+
return this._client.post('/x/accounts', { body, ...options });
|
|
26
26
|
}
|
|
27
27
|
|
|
28
28
|
/**
|
|
@@ -36,7 +36,7 @@ export class Accounts extends APIResource {
|
|
|
36
36
|
* ```
|
|
37
37
|
*/
|
|
38
38
|
retrieve(id: string, options?: RequestOptions): APIPromise<XAccountDetail> {
|
|
39
|
-
return this._client.get(path`/x/accounts/${id}`,
|
|
39
|
+
return this._client.get(path`/x/accounts/${id}`, options);
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
/**
|
|
@@ -48,7 +48,7 @@ export class Accounts extends APIResource {
|
|
|
48
48
|
* ```
|
|
49
49
|
*/
|
|
50
50
|
list(options?: RequestOptions): APIPromise<AccountListResponse> {
|
|
51
|
-
return this._client.get('/x/accounts',
|
|
51
|
+
return this._client.get('/x/accounts', options);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
/**
|
|
@@ -60,7 +60,7 @@ export class Accounts extends APIResource {
|
|
|
60
60
|
* ```
|
|
61
61
|
*/
|
|
62
62
|
delete(id: string, options?: RequestOptions): APIPromise<AccountDeleteResponse> {
|
|
63
|
-
return this._client.delete(path`/x/accounts/${id}`,
|
|
63
|
+
return this._client.delete(path`/x/accounts/${id}`, options);
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
/**
|
|
@@ -73,7 +73,7 @@ export class Accounts extends APIResource {
|
|
|
73
73
|
* ```
|
|
74
74
|
*/
|
|
75
75
|
bulkRetry(options?: RequestOptions): APIPromise<AccountBulkRetryResponse> {
|
|
76
|
-
return this._client.post('/x/accounts/bulk-retry',
|
|
76
|
+
return this._client.post('/x/accounts/bulk-retry', options);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
/**
|
|
@@ -88,11 +88,7 @@ export class Accounts extends APIResource {
|
|
|
88
88
|
* ```
|
|
89
89
|
*/
|
|
90
90
|
reauth(id: string, body: AccountReauthParams, options?: RequestOptions): APIPromise<AccountReauthResponse> {
|
|
91
|
-
return this._client.post(path`/x/accounts/${id}/reauth`, {
|
|
92
|
-
body,
|
|
93
|
-
...options,
|
|
94
|
-
__security: { apiKeyAuth: true },
|
|
95
|
-
});
|
|
91
|
+
return this._client.post(path`/x/accounts/${id}/reauth`, { body, ...options });
|
|
96
92
|
}
|
|
97
93
|
}
|
|
98
94
|
|
|
@@ -104,6 +100,15 @@ export interface XAccount {
|
|
|
104
100
|
|
|
105
101
|
createdAt: string;
|
|
106
102
|
|
|
103
|
+
/**
|
|
104
|
+
* Derived login/cookie health. `healthy` = cookies valid. `needsReauth` = user
|
|
105
|
+
* must submit fresh credentials. `locked` = X locked the account; unlock on x.com
|
|
106
|
+
* first. `suspended` = X banned the account. `recovering` = past cooldown, will
|
|
107
|
+
* auto-retry on next use. `temporaryIssue` = transient backend problem; retry
|
|
108
|
+
* shortly.
|
|
109
|
+
*/
|
|
110
|
+
health: 'healthy' | 'locked' | 'needsReauth' | 'recovering' | 'suspended' | 'temporaryIssue';
|
|
111
|
+
|
|
107
112
|
status: string;
|
|
108
113
|
|
|
109
114
|
xUserId: string;
|
|
@@ -119,6 +124,8 @@ export interface XAccountDetail {
|
|
|
119
124
|
|
|
120
125
|
createdAt: string;
|
|
121
126
|
|
|
127
|
+
health: 'healthy' | 'locked' | 'needsReauth' | 'recovering' | 'suspended' | 'temporaryIssue';
|
|
128
|
+
|
|
122
129
|
status: string;
|
|
123
130
|
|
|
124
131
|
xUserId: string;
|
|
@@ -132,14 +139,32 @@ export interface XAccountDetail {
|
|
|
132
139
|
updatedAt?: string;
|
|
133
140
|
}
|
|
134
141
|
|
|
142
|
+
/**
|
|
143
|
+
* Sanitized X account summary returned by connect and reauth. Includes an optional
|
|
144
|
+
* `loginCountry` field surfaced only when the declared proxy region had no Driver
|
|
145
|
+
* capacity and the login fell back to a single US consumer device for this
|
|
146
|
+
* one-time action. Future activity continues to use the selected `proxy_country`;
|
|
147
|
+
* the field is omitted on normal logins.
|
|
148
|
+
*/
|
|
135
149
|
export interface AccountCreateResponse {
|
|
136
150
|
id: string;
|
|
137
151
|
|
|
152
|
+
createdAt: string;
|
|
153
|
+
|
|
154
|
+
health: 'healthy' | 'locked' | 'needsReauth' | 'recovering' | 'suspended' | 'temporaryIssue';
|
|
155
|
+
|
|
138
156
|
status: string;
|
|
139
157
|
|
|
140
158
|
xUserId: string;
|
|
141
159
|
|
|
142
160
|
xUsername: string;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* ISO-3166-1 alpha-2 country code of the Driver consumer device used for this
|
|
164
|
+
* login. Present only when the US fallback was triggered because Driver had no
|
|
165
|
+
* capacity in the declared region. Omitted otherwise.
|
|
166
|
+
*/
|
|
167
|
+
loginCountry?: string;
|
|
143
168
|
}
|
|
144
169
|
|
|
145
170
|
export interface AccountListResponse {
|
|
@@ -157,12 +182,32 @@ export interface AccountBulkRetryResponse {
|
|
|
157
182
|
cleared: number;
|
|
158
183
|
}
|
|
159
184
|
|
|
185
|
+
/**
|
|
186
|
+
* Sanitized X account summary returned by connect and reauth. Includes an optional
|
|
187
|
+
* `loginCountry` field surfaced only when the declared proxy region had no Driver
|
|
188
|
+
* capacity and the login fell back to a single US consumer device for this
|
|
189
|
+
* one-time action. Future activity continues to use the selected `proxy_country`;
|
|
190
|
+
* the field is omitted on normal logins.
|
|
191
|
+
*/
|
|
160
192
|
export interface AccountReauthResponse {
|
|
161
193
|
id: string;
|
|
162
194
|
|
|
195
|
+
createdAt: string;
|
|
196
|
+
|
|
197
|
+
health: 'healthy' | 'locked' | 'needsReauth' | 'recovering' | 'suspended' | 'temporaryIssue';
|
|
198
|
+
|
|
163
199
|
status: string;
|
|
164
200
|
|
|
201
|
+
xUserId: string;
|
|
202
|
+
|
|
165
203
|
xUsername: string;
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* ISO-3166-1 alpha-2 country code of the Driver consumer device used for this
|
|
207
|
+
* login. Present only when the US fallback was triggered because Driver had no
|
|
208
|
+
* capacity in the declared region. Omitted otherwise.
|
|
209
|
+
*/
|
|
210
|
+
loginCountry?: string;
|
|
166
211
|
}
|
|
167
212
|
|
|
168
213
|
export interface AccountCreateParams {
|
|
@@ -198,6 +243,16 @@ export interface AccountReauthParams {
|
|
|
198
243
|
*/
|
|
199
244
|
password: string;
|
|
200
245
|
|
|
246
|
+
/**
|
|
247
|
+
* Email for the X account (updates stored email)
|
|
248
|
+
*/
|
|
249
|
+
email?: string;
|
|
250
|
+
|
|
251
|
+
/**
|
|
252
|
+
* Two-letter country code for login proxy region
|
|
253
|
+
*/
|
|
254
|
+
proxy_country?: string;
|
|
255
|
+
|
|
201
256
|
/**
|
|
202
257
|
* TOTP secret for 2FA re-authentication
|
|
203
258
|
*/
|
|
@@ -6,7 +6,7 @@ import { APIPromise } from '../../core/api-promise';
|
|
|
6
6
|
import { RequestOptions } from '../../internal/request-options';
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* Look up, search, and analyze individual tweets
|
|
10
10
|
*/
|
|
11
11
|
export class Bookmarks extends APIResource {
|
|
12
12
|
/**
|
|
@@ -50,7 +50,7 @@ export class Communities extends APIResource {
|
|
|
50
50
|
}
|
|
51
51
|
|
|
52
52
|
/**
|
|
53
|
-
* Get community
|
|
53
|
+
* Get community name, description and member count
|
|
54
54
|
*
|
|
55
55
|
* @example
|
|
56
56
|
* ```ts
|
|
@@ -64,7 +64,7 @@ export class Communities extends APIResource {
|
|
|
64
64
|
}
|
|
65
65
|
|
|
66
66
|
/**
|
|
67
|
-
*
|
|
67
|
+
* List members of a community
|
|
68
68
|
*
|
|
69
69
|
* @example
|
|
70
70
|
* ```ts
|
|
@@ -81,7 +81,7 @@ export class Communities extends APIResource {
|
|
|
81
81
|
}
|
|
82
82
|
|
|
83
83
|
/**
|
|
84
|
-
*
|
|
84
|
+
* List moderators of a community
|
|
85
85
|
*
|
|
86
86
|
* @example
|
|
87
87
|
* ```ts
|
|
@@ -98,7 +98,7 @@ export class Communities extends APIResource {
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
/**
|
|
101
|
-
* Search
|
|
101
|
+
* Search for communities by keyword
|
|
102
102
|
*
|
|
103
103
|
* @example
|
|
104
104
|
* ```ts
|
|
@@ -7,11 +7,11 @@ import { RequestOptions } from '../../../internal/request-options';
|
|
|
7
7
|
import { path } from '../../../internal/utils/path';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* X
|
|
10
|
+
* X Community info, members, and tweets
|
|
11
11
|
*/
|
|
12
12
|
export class Tweets extends APIResource {
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* List tweets across all communities
|
|
15
15
|
*
|
|
16
16
|
* @example
|
|
17
17
|
* ```ts
|
|
@@ -24,7 +24,7 @@ export class Tweets extends APIResource {
|
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
/**
|
|
27
|
-
*
|
|
27
|
+
* List tweets posted in a community
|
|
28
28
|
*
|
|
29
29
|
* @example
|
|
30
30
|
* ```ts
|
|
@@ -5,11 +5,11 @@ import { APIPromise } from '../../core/api-promise';
|
|
|
5
5
|
import { RequestOptions } from '../../internal/request-options';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* Look up, search, and explore user profiles and relationships
|
|
9
9
|
*/
|
|
10
10
|
export class Followers extends APIResource {
|
|
11
11
|
/**
|
|
12
|
-
* Check
|
|
12
|
+
* Check if one user follows another
|
|
13
13
|
*
|
|
14
14
|
* @example
|
|
15
15
|
* ```ts
|
package/src/resources/x/index.ts
CHANGED
|
@@ -57,7 +57,6 @@ export {
|
|
|
57
57
|
} from './profile';
|
|
58
58
|
export {
|
|
59
59
|
Tweets,
|
|
60
|
-
type SearchTweet,
|
|
61
60
|
type TweetAuthor,
|
|
62
61
|
type TweetDetail,
|
|
63
62
|
type TweetCreateResponse,
|
|
@@ -75,7 +74,6 @@ export {
|
|
|
75
74
|
} from './tweets/index';
|
|
76
75
|
export {
|
|
77
76
|
Users,
|
|
78
|
-
type UserProfile,
|
|
79
77
|
type UserRetrieveBatchParams,
|
|
80
78
|
type UserRetrieveFollowersParams,
|
|
81
79
|
type UserRetrieveFollowersYouKnowParams,
|
|
@@ -94,4 +92,5 @@ export {
|
|
|
94
92
|
type XGetTrendsResponse,
|
|
95
93
|
type XGetHomeTimelineParams,
|
|
96
94
|
type XGetNotificationsParams,
|
|
95
|
+
type XGetTrendsParams,
|
|
97
96
|
} from './x';
|
package/src/resources/x/lists.ts
CHANGED
|
@@ -7,11 +7,11 @@ import { RequestOptions } from '../../internal/request-options';
|
|
|
7
7
|
import { path } from '../../internal/utils/path';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* X
|
|
10
|
+
* X List followers, members, and tweets
|
|
11
11
|
*/
|
|
12
12
|
export class Lists extends APIResource {
|
|
13
13
|
/**
|
|
14
|
-
*
|
|
14
|
+
* List followers of an X List
|
|
15
15
|
*
|
|
16
16
|
* @example
|
|
17
17
|
* ```ts
|
|
@@ -28,7 +28,7 @@ export class Lists extends APIResource {
|
|
|
28
28
|
}
|
|
29
29
|
|
|
30
30
|
/**
|
|
31
|
-
*
|
|
31
|
+
* List members of an X List
|
|
32
32
|
*
|
|
33
33
|
* @example
|
|
34
34
|
* ```ts
|
|
@@ -46,7 +46,7 @@ export class Lists extends APIResource {
|
|
|
46
46
|
}
|
|
47
47
|
|
|
48
48
|
/**
|
|
49
|
-
*
|
|
49
|
+
* List tweets from an X List
|
|
50
50
|
*
|
|
51
51
|
* @example
|
|
52
52
|
* ```ts
|
package/src/resources/x/media.ts
CHANGED
|
@@ -7,11 +7,11 @@ import { RequestOptions } from '../../internal/request-options';
|
|
|
7
7
|
import { multipartFormRequestOptions } from '../../internal/uploads';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
* Media upload
|
|
10
|
+
* Media upload and download
|
|
11
11
|
*/
|
|
12
12
|
export class Media extends APIResource {
|
|
13
13
|
/**
|
|
14
|
-
* Download
|
|
14
|
+
* Download images and videos from tweets
|
|
15
15
|
*
|
|
16
16
|
* @example
|
|
17
17
|
* ```ts
|