x-twitter-scraper 0.18.0 → 0.20.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/CHANGELOG.md +48 -0
- package/README.md +1 -0
- package/client.d.mts +7 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +7 -0
- package/client.d.ts.map +1 -1
- package/client.js +6 -0
- package/client.js.map +1 -1
- package/client.mjs +6 -0
- package/client.mjs.map +1 -1
- package/package.json +3 -3
- package/resources/account.d.mts +1 -1
- package/resources/account.d.mts.map +1 -1
- package/resources/account.d.ts +1 -1
- package/resources/account.d.ts.map +1 -1
- package/resources/activity.d.mts +230 -0
- package/resources/activity.d.mts.map +1 -0
- package/resources/activity.d.ts +230 -0
- package/resources/activity.d.ts.map +1 -0
- package/resources/activity.js +67 -0
- package/resources/activity.js.map +1 -0
- package/resources/activity.mjs +63 -0
- package/resources/activity.mjs.map +1 -0
- package/resources/credits.d.mts +29 -0
- package/resources/credits.d.mts.map +1 -1
- package/resources/credits.d.ts +29 -0
- package/resources/credits.d.ts.map +1 -1
- package/resources/credits.js.map +1 -1
- package/resources/credits.mjs.map +1 -1
- package/resources/events.d.mts +69 -0
- package/resources/events.d.mts.map +1 -1
- package/resources/events.d.ts +69 -0
- package/resources/events.d.ts.map +1 -1
- package/resources/events.js +2 -1
- package/resources/events.js.map +1 -1
- package/resources/events.mjs +2 -1
- package/resources/events.mjs.map +1 -1
- package/resources/extractions.d.mts +56 -0
- package/resources/extractions.d.mts.map +1 -1
- package/resources/extractions.d.ts +56 -0
- package/resources/extractions.d.ts.map +1 -1
- package/resources/index.d.mts +1 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/monitors/posts.d.mts +45 -1
- package/resources/monitors/posts.d.mts.map +1 -1
- package/resources/monitors/posts.d.ts +45 -1
- package/resources/monitors/posts.d.ts.map +1 -1
- package/resources/monitors/posts.js +1 -1
- package/resources/monitors/posts.mjs +1 -1
- package/resources/radar.d.mts +9 -0
- package/resources/radar.d.mts.map +1 -1
- package/resources/radar.d.ts +9 -0
- package/resources/radar.d.ts.map +1 -1
- package/resources/shared.d.mts +67 -1
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +67 -1
- package/resources/shared.d.ts.map +1 -1
- package/resources/subscribe.d.mts +11 -0
- package/resources/subscribe.d.mts.map +1 -1
- package/resources/subscribe.d.ts +11 -0
- package/resources/subscribe.d.ts.map +1 -1
- package/resources/subscribe.js.map +1 -1
- package/resources/subscribe.mjs.map +1 -1
- package/resources/x/communities/communities.d.mts +17 -0
- package/resources/x/communities/communities.d.mts.map +1 -1
- package/resources/x/communities/communities.d.ts +17 -0
- package/resources/x/communities/communities.d.ts.map +1 -1
- package/resources/x/communities/communities.js +7 -4
- package/resources/x/communities/communities.js.map +1 -1
- package/resources/x/communities/communities.mjs +7 -4
- package/resources/x/communities/communities.mjs.map +1 -1
- package/resources/x/communities/join.d.mts +14 -0
- package/resources/x/communities/join.d.mts.map +1 -1
- package/resources/x/communities/join.d.ts +14 -0
- package/resources/x/communities/join.d.ts.map +1 -1
- package/resources/x/communities/join.js +4 -4
- package/resources/x/communities/join.js.map +1 -1
- package/resources/x/communities/join.mjs +4 -4
- package/resources/x/communities/join.mjs.map +1 -1
- package/resources/x/dm.d.mts +14 -0
- package/resources/x/dm.d.mts.map +1 -1
- package/resources/x/dm.d.ts +14 -0
- package/resources/x/dm.d.ts.map +1 -1
- package/resources/x/dm.js +4 -4
- package/resources/x/dm.js.map +1 -1
- package/resources/x/dm.mjs +4 -4
- package/resources/x/dm.mjs.map +1 -1
- package/resources/x/index.d.mts +2 -2
- package/resources/x/index.d.mts.map +1 -1
- package/resources/x/index.d.ts +2 -2
- 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/media.d.mts +43 -0
- package/resources/x/media.d.mts.map +1 -1
- package/resources/x/media.d.ts +43 -0
- package/resources/x/media.d.ts.map +1 -1
- package/resources/x/media.js +2 -2
- package/resources/x/media.js.map +1 -1
- package/resources/x/media.mjs +2 -2
- package/resources/x/media.mjs.map +1 -1
- package/resources/x/profile.d.mts +21 -0
- package/resources/x/profile.d.mts.map +1 -1
- package/resources/x/profile.d.ts +21 -0
- package/resources/x/profile.d.ts.map +1 -1
- package/resources/x/profile.js +6 -6
- package/resources/x/profile.js.map +1 -1
- package/resources/x/profile.mjs +6 -6
- package/resources/x/profile.mjs.map +1 -1
- package/resources/x/sports.d.mts +309 -2
- package/resources/x/sports.d.mts.map +1 -1
- package/resources/x/sports.d.ts +309 -2
- package/resources/x/sports.d.ts.map +1 -1
- package/resources/x/sports.js +49 -1
- package/resources/x/sports.js.map +1 -1
- package/resources/x/sports.mjs +49 -1
- package/resources/x/sports.mjs.map +1 -1
- package/resources/x/tweets/like.d.mts +14 -0
- package/resources/x/tweets/like.d.mts.map +1 -1
- package/resources/x/tweets/like.d.ts +14 -0
- package/resources/x/tweets/like.d.ts.map +1 -1
- package/resources/x/tweets/like.js +4 -4
- package/resources/x/tweets/like.js.map +1 -1
- package/resources/x/tweets/like.mjs +4 -4
- package/resources/x/tweets/like.mjs.map +1 -1
- package/resources/x/tweets/retweet.d.mts +14 -0
- package/resources/x/tweets/retweet.d.mts.map +1 -1
- package/resources/x/tweets/retweet.d.ts +14 -0
- package/resources/x/tweets/retweet.d.ts.map +1 -1
- package/resources/x/tweets/retweet.js +4 -4
- package/resources/x/tweets/retweet.js.map +1 -1
- package/resources/x/tweets/retweet.mjs +4 -4
- package/resources/x/tweets/retweet.mjs.map +1 -1
- package/resources/x/tweets/tweets.d.mts +58 -0
- package/resources/x/tweets/tweets.d.mts.map +1 -1
- package/resources/x/tweets/tweets.d.ts +58 -0
- package/resources/x/tweets/tweets.d.ts.map +1 -1
- package/resources/x/tweets/tweets.js +4 -4
- package/resources/x/tweets/tweets.js.map +1 -1
- package/resources/x/tweets/tweets.mjs +4 -4
- package/resources/x/tweets/tweets.mjs.map +1 -1
- package/resources/x/users/follow.d.mts +14 -0
- package/resources/x/users/follow.d.mts.map +1 -1
- package/resources/x/users/follow.d.ts +14 -0
- package/resources/x/users/follow.d.ts.map +1 -1
- package/resources/x/users/follow.js +4 -4
- package/resources/x/users/follow.js.map +1 -1
- package/resources/x/users/follow.mjs +4 -4
- package/resources/x/users/follow.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 +425 -1
- package/resources/x/users/users.d.mts.map +1 -1
- package/resources/x/users/users.d.ts +425 -1
- package/resources/x/users/users.d.ts.map +1 -1
- package/resources/x/users/users.js +17 -2
- package/resources/x/users/users.js.map +1 -1
- package/resources/x/users/users.mjs +17 -2
- package/resources/x/users/users.mjs.map +1 -1
- package/resources/x/x.d.mts +4 -4
- package/resources/x/x.d.mts.map +1 -1
- package/resources/x/x.d.ts +4 -4
- package/resources/x/x.d.ts.map +1 -1
- package/resources/x/x.js.map +1 -1
- package/resources/x/x.mjs.map +1 -1
- package/skills/x-twitter-scraper/references/api-endpoints-draws.md +13 -13
- package/skills/x-twitter-scraper/references/draws.md +3 -3
- package/skills/x-twitter-scraper/references/python-examples.md +2 -2
- package/src/client.ts +23 -0
- package/src/resources/account.ts +1 -1
- package/src/resources/activity.ts +341 -0
- package/src/resources/credits.ts +35 -0
- package/src/resources/events.ts +85 -1
- package/src/resources/extractions.ts +67 -0
- package/src/resources/index.ts +8 -0
- package/src/resources/monitors/posts.ts +58 -1
- package/src/resources/radar.ts +10 -0
- package/src/resources/shared.ts +123 -0
- package/src/resources/subscribe.ts +13 -0
- package/src/resources/x/communities/communities.ts +23 -4
- package/src/resources/x/communities/join.ts +20 -4
- package/src/resources/x/dm.ts +20 -4
- package/src/resources/x/index.ts +13 -0
- package/src/resources/x/media.ts +60 -2
- package/src/resources/x/profile.ts +30 -6
- package/src/resources/x/sports.ts +379 -1
- package/src/resources/x/tweets/like.ts +20 -4
- package/src/resources/x/tweets/retweet.ts +20 -4
- package/src/resources/x/tweets/tweets.ts +70 -4
- package/src/resources/x/users/follow.ts +20 -4
- package/src/resources/x/users/index.ts +3 -0
- package/src/resources/x/users/users.ts +513 -2
- package/src/resources/x/x.ts +26 -0
- 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
|
@@ -29,11 +29,11 @@ export class Profile extends APIResource {
|
|
|
29
29
|
* ```
|
|
30
30
|
*/
|
|
31
31
|
update(params: ProfileUpdateParams, options?: RequestOptions): APIPromise<ProfileUpdateResponse> {
|
|
32
|
-
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
32
|
+
const { 'Idempotency-Key': idempotencyKey, Prefer: prefer, ...body } = params;
|
|
33
33
|
return this._client.patch('/x/profile', {
|
|
34
34
|
body,
|
|
35
35
|
...options,
|
|
36
|
-
headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey }, options?.headers]),
|
|
36
|
+
headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey, Prefer: prefer }, options?.headers]),
|
|
37
37
|
});
|
|
38
38
|
}
|
|
39
39
|
|
|
@@ -53,14 +53,14 @@ export class Profile extends APIResource {
|
|
|
53
53
|
params: ProfileUpdateAvatarParams,
|
|
54
54
|
options?: RequestOptions,
|
|
55
55
|
): APIPromise<ProfileUpdateAvatarResponse> {
|
|
56
|
-
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
56
|
+
const { 'Idempotency-Key': idempotencyKey, Prefer: prefer, ...body } = params;
|
|
57
57
|
return this._client.patch(
|
|
58
58
|
'/x/profile/avatar',
|
|
59
59
|
maybeMultipartFormRequestOptions(
|
|
60
60
|
{
|
|
61
61
|
body,
|
|
62
62
|
...options,
|
|
63
|
-
headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey }, options?.headers]),
|
|
63
|
+
headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey, Prefer: prefer }, options?.headers]),
|
|
64
64
|
},
|
|
65
65
|
this._client,
|
|
66
66
|
),
|
|
@@ -83,14 +83,14 @@ export class Profile extends APIResource {
|
|
|
83
83
|
params: ProfileUpdateBannerParams,
|
|
84
84
|
options?: RequestOptions,
|
|
85
85
|
): APIPromise<ProfileUpdateBannerResponse> {
|
|
86
|
-
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
86
|
+
const { 'Idempotency-Key': idempotencyKey, Prefer: prefer, ...body } = params;
|
|
87
87
|
return this._client.patch(
|
|
88
88
|
'/x/profile/banner',
|
|
89
89
|
maybeMultipartFormRequestOptions(
|
|
90
90
|
{
|
|
91
91
|
body,
|
|
92
92
|
...options,
|
|
93
|
-
headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey }, options?.headers]),
|
|
93
|
+
headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey, Prefer: prefer }, options?.headers]),
|
|
94
94
|
},
|
|
95
95
|
this._client,
|
|
96
96
|
),
|
|
@@ -867,6 +867,14 @@ export interface ProfileUpdateParams {
|
|
|
867
867
|
*/
|
|
868
868
|
'Idempotency-Key': string;
|
|
869
869
|
|
|
870
|
+
/**
|
|
871
|
+
* Header param: A long write answers 202 with a status link, then lands on X.
|
|
872
|
+
* `wait=<seconds>` asks for the answer within that many seconds, up to 85. If
|
|
873
|
+
* the write is still running then, the API answers 202 with Location. Poll
|
|
874
|
+
* Location until `terminal` is true, and don't send the write again.
|
|
875
|
+
*/
|
|
876
|
+
Prefer?: string;
|
|
877
|
+
|
|
870
878
|
/**
|
|
871
879
|
* Body param: Bio, up to 160 characters. An emoji counts as 2.
|
|
872
880
|
*/
|
|
@@ -913,6 +921,14 @@ export interface ProfileUpdateAvatarParams {
|
|
|
913
921
|
* days.
|
|
914
922
|
*/
|
|
915
923
|
'Idempotency-Key': string;
|
|
924
|
+
|
|
925
|
+
/**
|
|
926
|
+
* Header param: A long write answers 202 with a status link, then lands on X.
|
|
927
|
+
* `wait=<seconds>` asks for the answer within that many seconds, up to 85. If
|
|
928
|
+
* the write is still running then, the API answers 202 with Location. Poll
|
|
929
|
+
* Location until `terminal` is true, and don't send the write again.
|
|
930
|
+
*/
|
|
931
|
+
Prefer?: string;
|
|
916
932
|
}
|
|
917
933
|
|
|
918
934
|
export interface ProfileUpdateBannerParams {
|
|
@@ -940,6 +956,14 @@ export interface ProfileUpdateBannerParams {
|
|
|
940
956
|
* days.
|
|
941
957
|
*/
|
|
942
958
|
'Idempotency-Key': string;
|
|
959
|
+
|
|
960
|
+
/**
|
|
961
|
+
* Header param: A long write answers 202 with a status link, then lands on X.
|
|
962
|
+
* `wait=<seconds>` asks for the answer within that many seconds, up to 85. If
|
|
963
|
+
* the write is still running then, the API answers 202 with Location. Poll
|
|
964
|
+
* Location until `terminal` is true, and don't send the write again.
|
|
965
|
+
*/
|
|
966
|
+
Prefer?: string;
|
|
943
967
|
}
|
|
944
968
|
|
|
945
969
|
export declare namespace Profile {
|
|
@@ -3,12 +3,14 @@
|
|
|
3
3
|
// SPDX-License-Identifier: Apache-2.0
|
|
4
4
|
|
|
5
5
|
import { APIResource } from '../../core/resource';
|
|
6
|
+
import * as Shared from '../shared';
|
|
6
7
|
import { APIPromise } from '../../core/api-promise';
|
|
7
8
|
import { RequestOptions } from '../../internal/request-options';
|
|
8
9
|
import { path } from '../../internal/utils/path';
|
|
9
10
|
|
|
10
11
|
/**
|
|
11
|
-
* NFL & college football games, scoreboards, plays, box scores
|
|
12
|
+
* NFL & college football games, scoreboards, plays, box scores, audiences,
|
|
13
|
+
* rosters, player props & posts
|
|
12
14
|
*/
|
|
13
15
|
export class Sports extends APIResource {
|
|
14
16
|
/**
|
|
@@ -111,6 +113,64 @@ export class Sports extends APIResource {
|
|
|
111
113
|
const { league, ...query } = params;
|
|
112
114
|
return this._client.get(path`/x/sports/${league}/games/${id}/audience`, { query, ...options });
|
|
113
115
|
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Returns both teams' players for 1 NFL game. Each player has a jersey,
|
|
119
|
+
* position, headshot & X account. Each request costs 1 credit.
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```ts
|
|
123
|
+
* const footballRoster = await client.x.sports.retrieveRoster('2055084502741811200', {
|
|
124
|
+
* league: 'nfl',
|
|
125
|
+
* });
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
128
|
+
retrieveRoster(
|
|
129
|
+
id: string,
|
|
130
|
+
params: SportRetrieveRosterParams,
|
|
131
|
+
options?: RequestOptions,
|
|
132
|
+
): APIPromise<FootballRoster> {
|
|
133
|
+
const { league, ...query } = params;
|
|
134
|
+
return this._client.get(path`/x/sports/${league}/games/${id}/roster`, { query, ...options });
|
|
135
|
+
}
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Returns the player prop lines & American odds X shows for 1 NFL game. X lists
|
|
139
|
+
* props before & during a game. Other games return no categories. Each request
|
|
140
|
+
* costs 1 credit.
|
|
141
|
+
*
|
|
142
|
+
* @example
|
|
143
|
+
* ```ts
|
|
144
|
+
* const footballProps = await client.x.sports.retrievePlayerProps('2055084502741811200', {
|
|
145
|
+
* league: 'nfl',
|
|
146
|
+
* });
|
|
147
|
+
* ```
|
|
148
|
+
*/
|
|
149
|
+
retrievePlayerProps(
|
|
150
|
+
id: string,
|
|
151
|
+
params: SportRetrievePlayerPropsParams,
|
|
152
|
+
options?: RequestOptions,
|
|
153
|
+
): APIPromise<FootballProps> {
|
|
154
|
+
const { league, ...query } = params;
|
|
155
|
+
return this._client.get(path`/x/sports/${league}/games/${id}/player-props`, { query, ...options });
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* Returns the posts X shows on a game's page, with the X search that finds them.
|
|
160
|
+
* Works before, during & after the game. Pages hold up to 20 posts, & each post
|
|
161
|
+
* costs 1 credit.
|
|
162
|
+
*
|
|
163
|
+
* @example
|
|
164
|
+
* ```ts
|
|
165
|
+
* const sportsGamePosts = await client.x.sports.listPosts('2055084502741811200', {
|
|
166
|
+
* league: 'nfl',
|
|
167
|
+
* });
|
|
168
|
+
* ```
|
|
169
|
+
*/
|
|
170
|
+
listPosts(id: string, params: SportListPostsParams, options?: RequestOptions): APIPromise<SportsGamePosts> {
|
|
171
|
+
const { league, ...query } = params;
|
|
172
|
+
return this._client.get(path`/x/sports/${league}/games/${id}/posts`, { query, ...options });
|
|
173
|
+
}
|
|
114
174
|
}
|
|
115
175
|
|
|
116
176
|
/**
|
|
@@ -301,6 +361,45 @@ export interface SportsTeamRecord {
|
|
|
301
361
|
ties: number | null;
|
|
302
362
|
}
|
|
303
363
|
|
|
364
|
+
/**
|
|
365
|
+
* A recent game of a team, as X lists it with the team.
|
|
366
|
+
*/
|
|
367
|
+
export interface SportsTeamGame {
|
|
368
|
+
/**
|
|
369
|
+
* The game ID, which the game routes take.
|
|
370
|
+
*/
|
|
371
|
+
id: string;
|
|
372
|
+
|
|
373
|
+
/**
|
|
374
|
+
* When this game kicked off, in UTC. Null when X shows no time.
|
|
375
|
+
*/
|
|
376
|
+
startsAt: string | null;
|
|
377
|
+
|
|
378
|
+
/**
|
|
379
|
+
* The stadium. X has sent none in recent games so far.
|
|
380
|
+
*/
|
|
381
|
+
venue: string | null;
|
|
382
|
+
|
|
383
|
+
/**
|
|
384
|
+
* This game's status as X names it, such as Closed.
|
|
385
|
+
*/
|
|
386
|
+
status: string | null;
|
|
387
|
+
|
|
388
|
+
/**
|
|
389
|
+
* The game clock, as X writes it. X has sent none so far.
|
|
390
|
+
*/
|
|
391
|
+
clock: string | null;
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* The current or last quarter. X has sent none so far.
|
|
395
|
+
*/
|
|
396
|
+
quarter: number | null;
|
|
397
|
+
|
|
398
|
+
home: FootballTeamScore;
|
|
399
|
+
|
|
400
|
+
away: FootballTeamScore;
|
|
401
|
+
}
|
|
402
|
+
|
|
304
403
|
/**
|
|
305
404
|
* A team, as X's sports pages show it.
|
|
306
405
|
*/
|
|
@@ -356,6 +455,13 @@ export interface SportsTeam {
|
|
|
356
455
|
* football games.
|
|
357
456
|
*/
|
|
358
457
|
record: SportsTeamRecord | null;
|
|
458
|
+
|
|
459
|
+
/**
|
|
460
|
+
* The team's recent games, newest first. Games without a kickoff time come
|
|
461
|
+
* last. X sends them only with the teams of a college football game. The list
|
|
462
|
+
* is empty elsewhere.
|
|
463
|
+
*/
|
|
464
|
+
recentGames: Array<SportsTeamGame>;
|
|
359
465
|
}
|
|
360
466
|
|
|
361
467
|
/**
|
|
@@ -760,6 +866,22 @@ export interface FootballPlayerXUser {
|
|
|
760
866
|
* Whether the account has a blue check.
|
|
761
867
|
*/
|
|
762
868
|
blueVerified: boolean | null;
|
|
869
|
+
|
|
870
|
+
/**
|
|
871
|
+
* Whether the account protects its posts. Only rosters carry it.
|
|
872
|
+
*/
|
|
873
|
+
protected: boolean | null;
|
|
874
|
+
|
|
875
|
+
/**
|
|
876
|
+
* Whether the account can offer subscriptions. Only rosters carry it.
|
|
877
|
+
*/
|
|
878
|
+
superFollowEligible: boolean | null;
|
|
879
|
+
|
|
880
|
+
/**
|
|
881
|
+
* The label X highlights on the account, such as BusinessLabel. Only rosters
|
|
882
|
+
* carry it.
|
|
883
|
+
*/
|
|
884
|
+
labelType: string | null;
|
|
763
885
|
}
|
|
764
886
|
|
|
765
887
|
/**
|
|
@@ -1682,6 +1804,158 @@ export interface SportsGameAudience {
|
|
|
1682
1804
|
teams: { [key: string]: SportsTeam };
|
|
1683
1805
|
}
|
|
1684
1806
|
|
|
1807
|
+
/**
|
|
1808
|
+
* 1 team's roster.
|
|
1809
|
+
*/
|
|
1810
|
+
export interface FootballRosterTeam {
|
|
1811
|
+
/**
|
|
1812
|
+
* The team this roster belongs to, a key of teams.
|
|
1813
|
+
*/
|
|
1814
|
+
teamId: string;
|
|
1815
|
+
|
|
1816
|
+
/**
|
|
1817
|
+
* The team's players in X's order, keys of players.
|
|
1818
|
+
*/
|
|
1819
|
+
playerIds: Array<string>;
|
|
1820
|
+
}
|
|
1821
|
+
|
|
1822
|
+
/**
|
|
1823
|
+
* Both teams' rosters for 1 NFL game.
|
|
1824
|
+
*/
|
|
1825
|
+
export interface FootballRoster {
|
|
1826
|
+
/**
|
|
1827
|
+
* The ID of the game these rosters cover.
|
|
1828
|
+
*/
|
|
1829
|
+
id: string;
|
|
1830
|
+
|
|
1831
|
+
/**
|
|
1832
|
+
* The league of the game these rosters cover.
|
|
1833
|
+
*/
|
|
1834
|
+
league: 'nfl';
|
|
1835
|
+
|
|
1836
|
+
/**
|
|
1837
|
+
* Each team's roster, in X's order.
|
|
1838
|
+
*/
|
|
1839
|
+
rosters: Array<FootballRosterTeam>;
|
|
1840
|
+
|
|
1841
|
+
/**
|
|
1842
|
+
* The 2 teams, by team ID.
|
|
1843
|
+
*/
|
|
1844
|
+
teams: { [key: string]: SportsTeam };
|
|
1845
|
+
|
|
1846
|
+
/**
|
|
1847
|
+
* Every rostered player, by player ID. Rosters carry no college or birth
|
|
1848
|
+
* details & only a medium headshot, so the rest are null.
|
|
1849
|
+
*/
|
|
1850
|
+
players: { [key: string]: FootballPlayer };
|
|
1851
|
+
}
|
|
1852
|
+
|
|
1853
|
+
/**
|
|
1854
|
+
* 1 player's line & odds in a prop category.
|
|
1855
|
+
*/
|
|
1856
|
+
export interface FootballPlayerProp {
|
|
1857
|
+
/**
|
|
1858
|
+
* The player the line is for, a key of players.
|
|
1859
|
+
*/
|
|
1860
|
+
playerId: string | null;
|
|
1861
|
+
|
|
1862
|
+
/**
|
|
1863
|
+
* The line's place in its category, from 1.
|
|
1864
|
+
*/
|
|
1865
|
+
rank: number | null;
|
|
1866
|
+
|
|
1867
|
+
/**
|
|
1868
|
+
* The line the odds price, such as 248.5 yards. Null when the prop has no
|
|
1869
|
+
* line, such as the first touchdown scorer.
|
|
1870
|
+
*/
|
|
1871
|
+
line: number | null;
|
|
1872
|
+
|
|
1873
|
+
/**
|
|
1874
|
+
* The American odds X shows first, such as -115 or 240.
|
|
1875
|
+
*/
|
|
1876
|
+
odds: number | null;
|
|
1877
|
+
|
|
1878
|
+
/**
|
|
1879
|
+
* The American odds X shows second. Null for a prop with 1 price.
|
|
1880
|
+
*/
|
|
1881
|
+
alternateOdds: number | null;
|
|
1882
|
+
|
|
1883
|
+
/**
|
|
1884
|
+
* Whether the sportsbook takes bets on the line.
|
|
1885
|
+
*/
|
|
1886
|
+
openForBetting: boolean | null;
|
|
1887
|
+
}
|
|
1888
|
+
|
|
1889
|
+
/**
|
|
1890
|
+
* 1 kind of player prop & its lines.
|
|
1891
|
+
*/
|
|
1892
|
+
export interface FootballPropCategory {
|
|
1893
|
+
/**
|
|
1894
|
+
* X's key for the prop, such as passing_yards.
|
|
1895
|
+
*/
|
|
1896
|
+
key: string | null;
|
|
1897
|
+
|
|
1898
|
+
/**
|
|
1899
|
+
* The name X shows for the prop.
|
|
1900
|
+
*/
|
|
1901
|
+
name: string | null;
|
|
1902
|
+
|
|
1903
|
+
/**
|
|
1904
|
+
* The category's place in X's order, from 1.
|
|
1905
|
+
*/
|
|
1906
|
+
rank: number | null;
|
|
1907
|
+
|
|
1908
|
+
/**
|
|
1909
|
+
* Each player's line, in X's order.
|
|
1910
|
+
*/
|
|
1911
|
+
props: Array<FootballPlayerProp>;
|
|
1912
|
+
}
|
|
1913
|
+
|
|
1914
|
+
/**
|
|
1915
|
+
* The player props X shows for 1 NFL game.
|
|
1916
|
+
*/
|
|
1917
|
+
export interface FootballProps {
|
|
1918
|
+
/**
|
|
1919
|
+
* The ID of the game these props cover.
|
|
1920
|
+
*/
|
|
1921
|
+
id: string;
|
|
1922
|
+
|
|
1923
|
+
/**
|
|
1924
|
+
* The league of the game these props cover.
|
|
1925
|
+
*/
|
|
1926
|
+
league: 'nfl';
|
|
1927
|
+
|
|
1928
|
+
/**
|
|
1929
|
+
* The sportsbook page X links for these props.
|
|
1930
|
+
*/
|
|
1931
|
+
sportsbookUrl: string | null;
|
|
1932
|
+
|
|
1933
|
+
/**
|
|
1934
|
+
* Each kind of prop, such as passing yards, in X's order. A game without props
|
|
1935
|
+
* has none.
|
|
1936
|
+
*/
|
|
1937
|
+
categories: Array<FootballPropCategory>;
|
|
1938
|
+
|
|
1939
|
+
/**
|
|
1940
|
+
* The players these props name, by player ID. X sends only each player's
|
|
1941
|
+
* name, jersey & team, so other fields are null.
|
|
1942
|
+
*/
|
|
1943
|
+
players: { [key: string]: FootballPlayer };
|
|
1944
|
+
}
|
|
1945
|
+
|
|
1946
|
+
/**
|
|
1947
|
+
* A page of 1 game's posts. Pass next_cursor as cursor for the next page.
|
|
1948
|
+
*/
|
|
1949
|
+
export interface SportsGamePosts extends Shared.PaginatedTweets {
|
|
1950
|
+
/**
|
|
1951
|
+
* The X search that finds this game's posts for the order asked. It names the
|
|
1952
|
+
* teams, hashtags, accounts & star players, with the game's time window. Send
|
|
1953
|
+
* it to client.x.tweets.search for more filters. Null when the game has no
|
|
1954
|
+
* such search.
|
|
1955
|
+
*/
|
|
1956
|
+
query: string | null;
|
|
1957
|
+
}
|
|
1958
|
+
|
|
1685
1959
|
export interface SportListGamesParams {
|
|
1686
1960
|
/**
|
|
1687
1961
|
* Fields to keep in each row, comma-separated. Use dots for nested fields,
|
|
@@ -1815,6 +2089,100 @@ export interface SportRetrieveAudienceParams {
|
|
|
1815
2089
|
omit?: string;
|
|
1816
2090
|
}
|
|
1817
2091
|
|
|
2092
|
+
export interface SportRetrieveRosterParams {
|
|
2093
|
+
/**
|
|
2094
|
+
* Path param: nfl, in any case. X has no college rosters or props, so ncaafb
|
|
2095
|
+
* gets a free 400 `unsupported_league`. Another value gets a free 400
|
|
2096
|
+
* `invalid_league`.
|
|
2097
|
+
*/
|
|
2098
|
+
league: 'nfl';
|
|
2099
|
+
|
|
2100
|
+
/**
|
|
2101
|
+
* Fields to keep in each row, comma-separated. Use dots for nested fields,
|
|
2102
|
+
* such as author.username. A list keeps the field in each item. Case &
|
|
2103
|
+
* underscores do not matter. A row that lacks a field leaves it out. Cursors,
|
|
2104
|
+
* counts & diagnostics always stay. An unknown name answers 400 unknown_field
|
|
2105
|
+
* with the valid names, before any read. The price stays the same. SDK row
|
|
2106
|
+
* types then hold only the named fields.
|
|
2107
|
+
*/
|
|
2108
|
+
fields?: string;
|
|
2109
|
+
|
|
2110
|
+
/**
|
|
2111
|
+
* Fields to drop from each row, comma-separated. It takes the same names as
|
|
2112
|
+
* fields. With fields, it drops from the kept fields.
|
|
2113
|
+
*/
|
|
2114
|
+
omit?: string;
|
|
2115
|
+
}
|
|
2116
|
+
|
|
2117
|
+
export interface SportRetrievePlayerPropsParams {
|
|
2118
|
+
/**
|
|
2119
|
+
* Path param: nfl, in any case. X has no college rosters or props, so ncaafb
|
|
2120
|
+
* gets a free 400 `unsupported_league`. Another value gets a free 400
|
|
2121
|
+
* `invalid_league`.
|
|
2122
|
+
*/
|
|
2123
|
+
league: 'nfl';
|
|
2124
|
+
|
|
2125
|
+
/**
|
|
2126
|
+
* Fields to keep in each row, comma-separated. Use dots for nested fields,
|
|
2127
|
+
* such as author.username. A list keeps the field in each item. Case &
|
|
2128
|
+
* underscores do not matter. A row that lacks a field leaves it out. Cursors,
|
|
2129
|
+
* counts & diagnostics always stay. An unknown name answers 400 unknown_field
|
|
2130
|
+
* with the valid names, before any read. The price stays the same. SDK row
|
|
2131
|
+
* types then hold only the named fields.
|
|
2132
|
+
*/
|
|
2133
|
+
fields?: string;
|
|
2134
|
+
|
|
2135
|
+
/**
|
|
2136
|
+
* Fields to drop from each row, comma-separated. It takes the same names as
|
|
2137
|
+
* fields. With fields, it drops from the kept fields.
|
|
2138
|
+
*/
|
|
2139
|
+
omit?: string;
|
|
2140
|
+
}
|
|
2141
|
+
|
|
2142
|
+
export interface SportListPostsParams {
|
|
2143
|
+
/**
|
|
2144
|
+
* Path param: nfl for the NFL or ncaafb for college football, in any case.
|
|
2145
|
+
* Another value gets a free 400 `invalid_league` before X is read.
|
|
2146
|
+
*/
|
|
2147
|
+
league: FootballLeague;
|
|
2148
|
+
|
|
2149
|
+
/**
|
|
2150
|
+
* Pagination cursor for collection results. Also read as next_cursor,
|
|
2151
|
+
* next_token, pagination_token or continuation_token.
|
|
2152
|
+
*/
|
|
2153
|
+
cursor?: string;
|
|
2154
|
+
|
|
2155
|
+
/**
|
|
2156
|
+
* Fields to keep in each row, comma-separated. Use dots for nested fields,
|
|
2157
|
+
* such as author.username. A list keeps the field in each item. Case &
|
|
2158
|
+
* underscores do not matter. A row that lacks a field leaves it out. Cursors,
|
|
2159
|
+
* counts & diagnostics always stay. An unknown name answers 400 unknown_field
|
|
2160
|
+
* with the valid names, before any read. The price stays the same. SDK row
|
|
2161
|
+
* types then hold only the named fields.
|
|
2162
|
+
*/
|
|
2163
|
+
fields?: string;
|
|
2164
|
+
|
|
2165
|
+
/**
|
|
2166
|
+
* Fields to drop from each row, comma-separated. It takes the same names as
|
|
2167
|
+
* fields. With fields, it drops from the kept fields.
|
|
2168
|
+
*/
|
|
2169
|
+
omit?: string;
|
|
2170
|
+
|
|
2171
|
+
/**
|
|
2172
|
+
* Items per page (1-100, default 20). Filters or credits can return fewer.
|
|
2173
|
+
* Follow next_cursor for more pages. Its aliases are limit, count, max_results,
|
|
2174
|
+
* maxItems, max_items & per_page.
|
|
2175
|
+
*/
|
|
2176
|
+
pageSize?: number;
|
|
2177
|
+
|
|
2178
|
+
/**
|
|
2179
|
+
* Top for the posts X ranks highest, or Latest for the newest. Any case works,
|
|
2180
|
+
* & so do Relevance & Recency. Alias order or sort. Send the same value with
|
|
2181
|
+
* each cursor.
|
|
2182
|
+
*/
|
|
2183
|
+
queryType?: 'Top' | 'Latest';
|
|
2184
|
+
}
|
|
2185
|
+
|
|
1818
2186
|
export declare namespace Sports {
|
|
1819
2187
|
export {
|
|
1820
2188
|
type FootballLeague as FootballLeague,
|
|
@@ -1866,6 +2234,7 @@ export declare namespace Sports {
|
|
|
1866
2234
|
type SportRetrieveBoxScoreParams as SportRetrieveBoxScoreParams,
|
|
1867
2235
|
type SportRetrievePlaysParams as SportRetrievePlaysParams,
|
|
1868
2236
|
type SportsTeamRecord as SportsTeamRecord,
|
|
2237
|
+
type SportsTeamGame as SportsTeamGame,
|
|
1869
2238
|
type SportsGameAudienceViewers as SportsGameAudienceViewers,
|
|
1870
2239
|
type SportsGameAudienceTeamPick as SportsGameAudienceTeamPick,
|
|
1871
2240
|
type SportsGameAudienceTeamPicks as SportsGameAudienceTeamPicks,
|
|
@@ -1873,5 +2242,14 @@ export declare namespace Sports {
|
|
|
1873
2242
|
type SportsGameAudienceChat as SportsGameAudienceChat,
|
|
1874
2243
|
type SportsGameAudience as SportsGameAudience,
|
|
1875
2244
|
type SportRetrieveAudienceParams as SportRetrieveAudienceParams,
|
|
2245
|
+
type FootballRosterTeam as FootballRosterTeam,
|
|
2246
|
+
type FootballRoster as FootballRoster,
|
|
2247
|
+
type FootballPlayerProp as FootballPlayerProp,
|
|
2248
|
+
type FootballPropCategory as FootballPropCategory,
|
|
2249
|
+
type FootballProps as FootballProps,
|
|
2250
|
+
type SportsGamePosts as SportsGamePosts,
|
|
2251
|
+
type SportRetrieveRosterParams as SportRetrieveRosterParams,
|
|
2252
|
+
type SportRetrievePlayerPropsParams as SportRetrievePlayerPropsParams,
|
|
2253
|
+
type SportListPostsParams as SportListPostsParams,
|
|
1876
2254
|
};
|
|
1877
2255
|
}
|
|
@@ -24,11 +24,11 @@ export class Like extends APIResource {
|
|
|
24
24
|
* ```
|
|
25
25
|
*/
|
|
26
26
|
create(id: string, params: LikeCreateParams, options?: RequestOptions): APIPromise<LikeCreateResponse> {
|
|
27
|
-
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
27
|
+
const { 'Idempotency-Key': idempotencyKey, Prefer: prefer, ...body } = params;
|
|
28
28
|
return this._client.post(path`/x/tweets/${id}/like`, {
|
|
29
29
|
body,
|
|
30
30
|
...options,
|
|
31
|
-
headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey }, options?.headers]),
|
|
31
|
+
headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey, Prefer: prefer }, options?.headers]),
|
|
32
32
|
});
|
|
33
33
|
}
|
|
34
34
|
|
|
@@ -44,11 +44,11 @@ export class Like extends APIResource {
|
|
|
44
44
|
* ```
|
|
45
45
|
*/
|
|
46
46
|
delete(id: string, params: LikeDeleteParams, options?: RequestOptions): APIPromise<LikeDeleteResponse> {
|
|
47
|
-
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
47
|
+
const { 'Idempotency-Key': idempotencyKey, Prefer: prefer, ...body } = params;
|
|
48
48
|
return this._client.delete(path`/x/tweets/${id}/like`, {
|
|
49
49
|
body,
|
|
50
50
|
...options,
|
|
51
|
-
headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey }, options?.headers]),
|
|
51
|
+
headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey, Prefer: prefer }, options?.headers]),
|
|
52
52
|
});
|
|
53
53
|
}
|
|
54
54
|
}
|
|
@@ -570,6 +570,14 @@ export interface LikeCreateParams {
|
|
|
570
570
|
* days.
|
|
571
571
|
*/
|
|
572
572
|
'Idempotency-Key': string;
|
|
573
|
+
|
|
574
|
+
/**
|
|
575
|
+
* Header param: A long write answers 202 with a status link, then lands on X.
|
|
576
|
+
* `wait=<seconds>` asks for the answer within that many seconds, up to 85. If
|
|
577
|
+
* the write is still running then, the API answers 202 with Location. Poll
|
|
578
|
+
* Location until `terminal` is true, and don't send the write again.
|
|
579
|
+
*/
|
|
580
|
+
Prefer?: string;
|
|
573
581
|
}
|
|
574
582
|
|
|
575
583
|
export interface LikeDeleteParams {
|
|
@@ -587,6 +595,14 @@ export interface LikeDeleteParams {
|
|
|
587
595
|
* days.
|
|
588
596
|
*/
|
|
589
597
|
'Idempotency-Key': string;
|
|
598
|
+
|
|
599
|
+
/**
|
|
600
|
+
* Header param: A long write answers 202 with a status link, then lands on X.
|
|
601
|
+
* `wait=<seconds>` asks for the answer within that many seconds, up to 85. If
|
|
602
|
+
* the write is still running then, the API answers 202 with Location. Poll
|
|
603
|
+
* Location until `terminal` is true, and don't send the write again.
|
|
604
|
+
*/
|
|
605
|
+
Prefer?: string;
|
|
590
606
|
}
|
|
591
607
|
|
|
592
608
|
export declare namespace Like {
|
|
@@ -28,11 +28,11 @@ export class Retweet extends APIResource {
|
|
|
28
28
|
params: RetweetCreateParams,
|
|
29
29
|
options?: RequestOptions,
|
|
30
30
|
): APIPromise<RetweetCreateResponse> {
|
|
31
|
-
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
31
|
+
const { 'Idempotency-Key': idempotencyKey, Prefer: prefer, ...body } = params;
|
|
32
32
|
return this._client.post(path`/x/tweets/${id}/retweet`, {
|
|
33
33
|
body,
|
|
34
34
|
...options,
|
|
35
|
-
headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey }, options?.headers]),
|
|
35
|
+
headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey, Prefer: prefer }, options?.headers]),
|
|
36
36
|
});
|
|
37
37
|
}
|
|
38
38
|
|
|
@@ -52,11 +52,11 @@ export class Retweet extends APIResource {
|
|
|
52
52
|
params: RetweetDeleteParams,
|
|
53
53
|
options?: RequestOptions,
|
|
54
54
|
): APIPromise<RetweetDeleteResponse> {
|
|
55
|
-
const { 'Idempotency-Key': idempotencyKey, ...body } = params;
|
|
55
|
+
const { 'Idempotency-Key': idempotencyKey, Prefer: prefer, ...body } = params;
|
|
56
56
|
return this._client.delete(path`/x/tweets/${id}/retweet`, {
|
|
57
57
|
body,
|
|
58
58
|
...options,
|
|
59
|
-
headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey }, options?.headers]),
|
|
59
|
+
headers: buildHeaders([{ 'Idempotency-Key': idempotencyKey, Prefer: prefer }, options?.headers]),
|
|
60
60
|
});
|
|
61
61
|
}
|
|
62
62
|
}
|
|
@@ -578,6 +578,14 @@ export interface RetweetCreateParams {
|
|
|
578
578
|
* days.
|
|
579
579
|
*/
|
|
580
580
|
'Idempotency-Key': string;
|
|
581
|
+
|
|
582
|
+
/**
|
|
583
|
+
* Header param: A long write answers 202 with a status link, then lands on X.
|
|
584
|
+
* `wait=<seconds>` asks for the answer within that many seconds, up to 85. If
|
|
585
|
+
* the write is still running then, the API answers 202 with Location. Poll
|
|
586
|
+
* Location until `terminal` is true, and don't send the write again.
|
|
587
|
+
*/
|
|
588
|
+
Prefer?: string;
|
|
581
589
|
}
|
|
582
590
|
|
|
583
591
|
export interface RetweetDeleteParams {
|
|
@@ -595,6 +603,14 @@ export interface RetweetDeleteParams {
|
|
|
595
603
|
* days.
|
|
596
604
|
*/
|
|
597
605
|
'Idempotency-Key': string;
|
|
606
|
+
|
|
607
|
+
/**
|
|
608
|
+
* Header param: A long write answers 202 with a status link, then lands on X.
|
|
609
|
+
* `wait=<seconds>` asks for the answer within that many seconds, up to 85. If
|
|
610
|
+
* the write is still running then, the API answers 202 with Location. Poll
|
|
611
|
+
* Location until `terminal` is true, and don't send the write again.
|
|
612
|
+
*/
|
|
613
|
+
Prefer?: string;
|
|
598
614
|
}
|
|
599
615
|
|
|
600
616
|
export declare namespace Retweet {
|