x-twitter-scraper 0.17.0 → 0.19.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 +35 -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 +214 -0
- package/resources/activity.d.mts.map +1 -0
- package/resources/activity.d.ts +214 -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 +24 -0
- package/resources/credits.d.mts.map +1 -1
- package/resources/credits.d.ts +24 -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 +8 -0
- package/resources/extractions.d.mts.map +1 -1
- package/resources/extractions.d.ts +8 -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/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/index.d.mts +1 -1
- package/resources/x/index.d.mts.map +1 -1
- package/resources/x/index.d.ts +1 -1
- 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 +36 -0
- package/resources/x/media.d.mts.map +1 -1
- package/resources/x/media.d.ts +36 -0
- package/resources/x/media.d.ts.map +1 -1
- package/resources/x/sports.d.mts +474 -4
- package/resources/x/sports.d.mts.map +1 -1
- package/resources/x/sports.d.ts +474 -4
- package/resources/x/sports.d.ts.map +1 -1
- package/resources/x/sports.js +64 -1
- package/resources/x/sports.js.map +1 -1
- package/resources/x/sports.mjs +64 -1
- package/resources/x/sports.mjs.map +1 -1
- package/resources/x/tweets/tweets.d.mts +31 -0
- package/resources/x/tweets/tweets.d.mts.map +1 -1
- package/resources/x/tweets/tweets.d.ts +31 -0
- package/resources/x/tweets/tweets.d.ts.map +1 -1
- package/resources/x/tweets/tweets.js.map +1 -1
- package/resources/x/tweets/tweets.mjs.map +1 -1
- package/resources/x/x.d.mts +2 -2
- package/resources/x/x.d.mts.map +1 -1
- package/resources/x/x.d.ts +2 -2
- 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 +302 -0
- package/src/resources/credits.ts +29 -0
- package/src/resources/events.ts +85 -1
- package/src/resources/extractions.ts +9 -0
- package/src/resources/index.ts +8 -0
- package/src/resources/monitors/posts.ts +58 -1
- package/src/resources/shared.ts +113 -0
- package/src/resources/subscribe.ts +13 -0
- package/src/resources/x/index.ts +18 -0
- package/src/resources/x/media.ts +50 -0
- package/src/resources/x/sports.ts +583 -3
- package/src/resources/x/tweets/tweets.ts +35 -0
- package/src/resources/x/x.ts +36 -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
package/src/resources/credits.ts
CHANGED
|
@@ -3,6 +3,7 @@
|
|
|
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 { buildHeaders } from '../internal/headers';
|
|
8
9
|
import { RequestOptions } from '../internal/request-options';
|
|
@@ -128,6 +129,17 @@ export interface CreditRetrieveTopupStatusResponse {
|
|
|
128
129
|
*/
|
|
129
130
|
amount_dollars?: number | null;
|
|
130
131
|
|
|
132
|
+
/**
|
|
133
|
+
* Currency the checkout charged.
|
|
134
|
+
*/
|
|
135
|
+
chargedCurrency?: Shared.Currency;
|
|
136
|
+
|
|
137
|
+
/**
|
|
138
|
+
* Amount the checkout charged before tax, in the currency's smallest unit.
|
|
139
|
+
* JPY and KRW have no decimals, so 1580 JPY is ¥1,580.
|
|
140
|
+
*/
|
|
141
|
+
chargedMinorUnits?: number;
|
|
142
|
+
|
|
131
143
|
/**
|
|
132
144
|
* Bigint string credit amount granted or pending.
|
|
133
145
|
*/
|
|
@@ -135,6 +147,17 @@ export interface CreditRetrieveTopupStatusResponse {
|
|
|
135
147
|
}
|
|
136
148
|
|
|
137
149
|
export interface CreditTopupBalanceResponse {
|
|
150
|
+
/**
|
|
151
|
+
* Currency the checkout charges.
|
|
152
|
+
*/
|
|
153
|
+
chargedCurrency: Shared.Currency;
|
|
154
|
+
|
|
155
|
+
/**
|
|
156
|
+
* Amount the checkout charges before tax, in the currency's smallest unit.
|
|
157
|
+
* JPY and KRW have no decimals, so 1580 JPY is ¥1,580.
|
|
158
|
+
*/
|
|
159
|
+
chargedMinorUnits: number;
|
|
160
|
+
|
|
138
161
|
/**
|
|
139
162
|
* Stable Xquik redirect URL for the active checkout.
|
|
140
163
|
*/
|
|
@@ -167,6 +190,12 @@ export interface CreditTopupBalanceParams {
|
|
|
167
190
|
*/
|
|
168
191
|
dollars: number;
|
|
169
192
|
|
|
193
|
+
/**
|
|
194
|
+
* Currency to pay in, USD by default. Credits always match the dollar amount.
|
|
195
|
+
* Lowercase codes work too. chargedCurrency shows the currency charged.
|
|
196
|
+
*/
|
|
197
|
+
currency?: Shared.Currency;
|
|
198
|
+
|
|
170
199
|
/**
|
|
171
200
|
* Optional site language for Stripe's return page. An unsupported 1 uses en, the
|
|
172
201
|
* default.
|
package/src/resources/events.ts
CHANGED
|
@@ -53,8 +53,9 @@ export class Events extends APIResource {
|
|
|
53
53
|
params: EventStreamParams | null | undefined = {},
|
|
54
54
|
options?: RequestOptions,
|
|
55
55
|
): APIPromise<Stream<Event>> {
|
|
56
|
-
const { 'Last-Event-ID': lastEventID } = params ?? {};
|
|
56
|
+
const { 'Last-Event-ID': lastEventID, ...query } = params ?? {};
|
|
57
57
|
return this._client.get('/events/stream', {
|
|
58
|
+
query,
|
|
58
59
|
...options,
|
|
59
60
|
headers: buildHeaders([
|
|
60
61
|
{
|
|
@@ -322,6 +323,11 @@ export namespace Event {
|
|
|
322
323
|
*/
|
|
323
324
|
limitedActions?: Array<MonitorPost.LimitedAction>;
|
|
324
325
|
|
|
326
|
+
/**
|
|
327
|
+
* The live event the post belongs to, such as an election.
|
|
328
|
+
*/
|
|
329
|
+
liveEventContext?: MonitorPost.LiveEventContext;
|
|
330
|
+
|
|
325
331
|
/**
|
|
326
332
|
* Media, omitted when unavailable.
|
|
327
333
|
*/
|
|
@@ -438,6 +444,12 @@ export namespace Event {
|
|
|
438
444
|
'retweetCount' | 'replyCount' | 'likeCount' | 'quoteCount' | 'viewCount' | 'bookmarkCount'
|
|
439
445
|
>;
|
|
440
446
|
|
|
447
|
+
/**
|
|
448
|
+
* The fields X did not send for this post. text reads empty, so treat it as
|
|
449
|
+
* unknown rather than empty. Left out when X sent the text.
|
|
450
|
+
*/
|
|
451
|
+
unknownFields?: Array<'text'>;
|
|
452
|
+
|
|
441
453
|
/**
|
|
442
454
|
* User IDs that left this conversation.
|
|
443
455
|
*/
|
|
@@ -1029,6 +1041,23 @@ export namespace Event {
|
|
|
1029
1041
|
}
|
|
1030
1042
|
}
|
|
1031
1043
|
|
|
1044
|
+
export interface LiveEventContext {
|
|
1045
|
+
/**
|
|
1046
|
+
* The event's image.
|
|
1047
|
+
*/
|
|
1048
|
+
imageUrl?: string;
|
|
1049
|
+
|
|
1050
|
+
/**
|
|
1051
|
+
* Event name.
|
|
1052
|
+
*/
|
|
1053
|
+
title?: string;
|
|
1054
|
+
|
|
1055
|
+
/**
|
|
1056
|
+
* The event's page on X.
|
|
1057
|
+
*/
|
|
1058
|
+
url?: string;
|
|
1059
|
+
}
|
|
1060
|
+
|
|
1032
1061
|
/**
|
|
1033
1062
|
* Complete Note Tweet content and rich-text metadata.
|
|
1034
1063
|
*/
|
|
@@ -1441,6 +1470,13 @@ export namespace Event {
|
|
|
1441
1470
|
}
|
|
1442
1471
|
|
|
1443
1472
|
export interface ReactionContext {
|
|
1473
|
+
/**
|
|
1474
|
+
* The post this one reacts to, with the same fields. X often sends only its
|
|
1475
|
+
* ID, author & edit history. Then unknownFields lists text, and the flags X
|
|
1476
|
+
* did not send are left out.
|
|
1477
|
+
*/
|
|
1478
|
+
reactedToPost?: QuotedTweet;
|
|
1479
|
+
|
|
1444
1480
|
reactedToPostId?: string;
|
|
1445
1481
|
|
|
1446
1482
|
/**
|
|
@@ -1964,6 +2000,11 @@ export namespace EventDetail {
|
|
|
1964
2000
|
*/
|
|
1965
2001
|
limitedActions?: Array<MonitorPost.LimitedAction>;
|
|
1966
2002
|
|
|
2003
|
+
/**
|
|
2004
|
+
* The live event the post belongs to, such as an election.
|
|
2005
|
+
*/
|
|
2006
|
+
liveEventContext?: MonitorPost.LiveEventContext;
|
|
2007
|
+
|
|
1967
2008
|
/**
|
|
1968
2009
|
* Media, omitted when unavailable.
|
|
1969
2010
|
*/
|
|
@@ -2080,6 +2121,12 @@ export namespace EventDetail {
|
|
|
2080
2121
|
'retweetCount' | 'replyCount' | 'likeCount' | 'quoteCount' | 'viewCount' | 'bookmarkCount'
|
|
2081
2122
|
>;
|
|
2082
2123
|
|
|
2124
|
+
/**
|
|
2125
|
+
* The fields X did not send for this post. text reads empty, so treat it as
|
|
2126
|
+
* unknown rather than empty. Left out when X sent the text.
|
|
2127
|
+
*/
|
|
2128
|
+
unknownFields?: Array<'text'>;
|
|
2129
|
+
|
|
2083
2130
|
/**
|
|
2084
2131
|
* User IDs that left this conversation.
|
|
2085
2132
|
*/
|
|
@@ -2671,6 +2718,23 @@ export namespace EventDetail {
|
|
|
2671
2718
|
}
|
|
2672
2719
|
}
|
|
2673
2720
|
|
|
2721
|
+
export interface LiveEventContext {
|
|
2722
|
+
/**
|
|
2723
|
+
* The event's image.
|
|
2724
|
+
*/
|
|
2725
|
+
imageUrl?: string;
|
|
2726
|
+
|
|
2727
|
+
/**
|
|
2728
|
+
* Event name.
|
|
2729
|
+
*/
|
|
2730
|
+
title?: string;
|
|
2731
|
+
|
|
2732
|
+
/**
|
|
2733
|
+
* The event's page on X.
|
|
2734
|
+
*/
|
|
2735
|
+
url?: string;
|
|
2736
|
+
}
|
|
2737
|
+
|
|
2674
2738
|
/**
|
|
2675
2739
|
* Complete Note Tweet content and rich-text metadata.
|
|
2676
2740
|
*/
|
|
@@ -3083,6 +3147,13 @@ export namespace EventDetail {
|
|
|
3083
3147
|
}
|
|
3084
3148
|
|
|
3085
3149
|
export interface ReactionContext {
|
|
3150
|
+
/**
|
|
3151
|
+
* The post this one reacts to, with the same fields. X often sends only its
|
|
3152
|
+
* ID, author & edit history. Then unknownFields lists text, and the flags X
|
|
3153
|
+
* did not send are left out.
|
|
3154
|
+
*/
|
|
3155
|
+
reactedToPost?: QuotedTweet;
|
|
3156
|
+
|
|
3086
3157
|
reactedToPostId?: string;
|
|
3087
3158
|
|
|
3088
3159
|
/**
|
|
@@ -3417,6 +3488,19 @@ export interface EventStreamParams {
|
|
|
3417
3488
|
* The last event ID the client got. The stream first sends every event after it.
|
|
3418
3489
|
*/
|
|
3419
3490
|
'Last-Event-ID'?: string;
|
|
3491
|
+
|
|
3492
|
+
/**
|
|
3493
|
+
* Set to post_metrics to also get each post monitor's saved numbers. Any other
|
|
3494
|
+
* value is refused.
|
|
3495
|
+
*/
|
|
3496
|
+
include?: 'post_metrics';
|
|
3497
|
+
|
|
3498
|
+
/**
|
|
3499
|
+
* Set to true to resume 30 seconds before Last-Event-ID, so late events still
|
|
3500
|
+
* arrive. Events you have can arrive again, so skip IDs you've seen. An ID the
|
|
3501
|
+
* stream can't find starts 5 minutes back, not 30 days.
|
|
3502
|
+
*/
|
|
3503
|
+
lookBack?: boolean;
|
|
3420
3504
|
}
|
|
3421
3505
|
|
|
3422
3506
|
export declare namespace Events {
|
|
@@ -322,6 +322,15 @@ export namespace ExtractionRetrieveResponse {
|
|
|
322
322
|
|
|
323
323
|
tweetUrl?: string;
|
|
324
324
|
|
|
325
|
+
/**
|
|
326
|
+
* Badge type X shows on the account, with outputPreset=flat. Business is the gold
|
|
327
|
+
* badge of a verified organization. Government is the grey badge of a government
|
|
328
|
+
* or multilateral account. Blue is the badge of X Premium. Default nested output
|
|
329
|
+
* uses enrichmentData.user.verifiedType. Absent when the account has none of these
|
|
330
|
+
* badges.
|
|
331
|
+
*/
|
|
332
|
+
verifiedType?: string;
|
|
333
|
+
|
|
325
334
|
/**
|
|
326
335
|
* Whole number from 0.
|
|
327
336
|
*/
|
package/src/resources/index.ts
CHANGED
|
@@ -11,6 +11,14 @@ export {
|
|
|
11
11
|
type AccountSetXUsernameParams,
|
|
12
12
|
type AccountUpdateLocaleParams,
|
|
13
13
|
} from './account';
|
|
14
|
+
export {
|
|
15
|
+
Activity,
|
|
16
|
+
type ActivityLogRow,
|
|
17
|
+
type ActivityRecord,
|
|
18
|
+
type ActivityListResponse,
|
|
19
|
+
type ActivityListParams,
|
|
20
|
+
type ActivityExportParams,
|
|
21
|
+
} from './activity';
|
|
14
22
|
export { Compose, type ComposeCreateResponse, type ComposeCreateParams } from './compose';
|
|
15
23
|
export {
|
|
16
24
|
Credits,
|
|
@@ -20,7 +20,7 @@ export class Posts extends APIResource {
|
|
|
20
20
|
* @example
|
|
21
21
|
* ```ts
|
|
22
22
|
* const postMonitor = await client.monitors.posts.create({
|
|
23
|
-
* post: 'https://x.com/
|
|
23
|
+
* post: 'https://x.com/NASA/status/2102882545427714266',
|
|
24
24
|
* });
|
|
25
25
|
* ```
|
|
26
26
|
*/
|
|
@@ -192,6 +192,21 @@ export interface PostMonitor {
|
|
|
192
192
|
|
|
193
193
|
authorName: string;
|
|
194
194
|
|
|
195
|
+
/**
|
|
196
|
+
* The author's profile picture. Omitted when X shows none.
|
|
197
|
+
*/
|
|
198
|
+
authorAvatarUrl?: string;
|
|
199
|
+
|
|
200
|
+
/**
|
|
201
|
+
* The author's verified badge on X. Omitted when the author has none.
|
|
202
|
+
*/
|
|
203
|
+
authorVerified?: 'blue' | 'business' | 'government';
|
|
204
|
+
|
|
205
|
+
/**
|
|
206
|
+
* Photos, videos & GIFs on the post, in X's order.
|
|
207
|
+
*/
|
|
208
|
+
media: Array<PostMonitor.Media>;
|
|
209
|
+
|
|
195
210
|
/**
|
|
196
211
|
* Text of the newest version Xquik read.
|
|
197
212
|
*/
|
|
@@ -214,6 +229,12 @@ export interface PostMonitor {
|
|
|
214
229
|
*/
|
|
215
230
|
nextBillingAt: string;
|
|
216
231
|
|
|
232
|
+
/**
|
|
233
|
+
* The post's counts when tracking began. Each metric's gain counts from here.
|
|
234
|
+
* views is null when X showed no view count.
|
|
235
|
+
*/
|
|
236
|
+
baseline: PostMonitor.Baseline;
|
|
237
|
+
|
|
217
238
|
/**
|
|
218
239
|
* The 6 metrics of a post.
|
|
219
240
|
*/
|
|
@@ -238,6 +259,42 @@ export interface PostMonitor {
|
|
|
238
259
|
pausedAt?: string;
|
|
239
260
|
}
|
|
240
261
|
|
|
262
|
+
export namespace PostMonitor {
|
|
263
|
+
/**
|
|
264
|
+
* 1 photo, video or GIF on the post.
|
|
265
|
+
*/
|
|
266
|
+
export interface Media {
|
|
267
|
+
kind: 'gif' | 'photo' | 'video';
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* The image URL. For a video or GIF, its preview image.
|
|
271
|
+
*/
|
|
272
|
+
url: string;
|
|
273
|
+
}
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* The post's counts when tracking began.
|
|
277
|
+
*/
|
|
278
|
+
export interface Baseline {
|
|
279
|
+
/**
|
|
280
|
+
* When tracking began.
|
|
281
|
+
*/
|
|
282
|
+
at: string;
|
|
283
|
+
|
|
284
|
+
views: number | null;
|
|
285
|
+
|
|
286
|
+
likes: number;
|
|
287
|
+
|
|
288
|
+
retweets: number;
|
|
289
|
+
|
|
290
|
+
replies: number;
|
|
291
|
+
|
|
292
|
+
quotes: number;
|
|
293
|
+
|
|
294
|
+
bookmarks: number;
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
241
298
|
/**
|
|
242
299
|
* A metric's value at the hour's end & its gain over that hour. Both are null
|
|
243
300
|
* when X shows no count.
|
package/src/resources/shared.ts
CHANGED
|
@@ -500,6 +500,43 @@ export namespace ContentDisclosure {
|
|
|
500
500
|
}
|
|
501
501
|
}
|
|
502
502
|
|
|
503
|
+
/**
|
|
504
|
+
* ISO 4217 code of a currency Xquik charges in.
|
|
505
|
+
*/
|
|
506
|
+
export type Currency =
|
|
507
|
+
| 'USD'
|
|
508
|
+
| 'EUR'
|
|
509
|
+
| 'GBP'
|
|
510
|
+
| 'TRY'
|
|
511
|
+
| 'JPY'
|
|
512
|
+
| 'CNY'
|
|
513
|
+
| 'KRW'
|
|
514
|
+
| 'CAD'
|
|
515
|
+
| 'AUD'
|
|
516
|
+
| 'MXN'
|
|
517
|
+
| 'AED'
|
|
518
|
+
| 'BRL'
|
|
519
|
+
| 'CHF'
|
|
520
|
+
| 'CZK'
|
|
521
|
+
| 'DKK'
|
|
522
|
+
| 'HKD'
|
|
523
|
+
| 'HUF'
|
|
524
|
+
| 'IDR'
|
|
525
|
+
| 'ILS'
|
|
526
|
+
| 'INR'
|
|
527
|
+
| 'MYR'
|
|
528
|
+
| 'NOK'
|
|
529
|
+
| 'NZD'
|
|
530
|
+
| 'PHP'
|
|
531
|
+
| 'PLN'
|
|
532
|
+
| 'QAR'
|
|
533
|
+
| 'RON'
|
|
534
|
+
| 'SAR'
|
|
535
|
+
| 'SEK'
|
|
536
|
+
| 'SGD'
|
|
537
|
+
| 'THB'
|
|
538
|
+
| 'ZAR';
|
|
539
|
+
|
|
503
540
|
/**
|
|
504
541
|
* A parent, quoted or retweeted tweet. It has the TweetPublicData fields and an
|
|
505
542
|
* author. Nesting stops after 4 levels.
|
|
@@ -661,6 +698,11 @@ export interface EmbeddedTweet {
|
|
|
661
698
|
*/
|
|
662
699
|
limitedActions?: Array<SearchTweet.LimitedAction>;
|
|
663
700
|
|
|
701
|
+
/**
|
|
702
|
+
* The live event the post belongs to, such as an election.
|
|
703
|
+
*/
|
|
704
|
+
liveEventContext?: SearchTweet.LiveEventContext;
|
|
705
|
+
|
|
664
706
|
/**
|
|
665
707
|
* Media, omitted when unavailable.
|
|
666
708
|
*/
|
|
@@ -779,6 +821,12 @@ export interface EmbeddedTweet {
|
|
|
779
821
|
'retweetCount' | 'replyCount' | 'likeCount' | 'quoteCount' | 'viewCount' | 'bookmarkCount'
|
|
780
822
|
>;
|
|
781
823
|
|
|
824
|
+
/**
|
|
825
|
+
* The fields X did not send for this post. text reads empty, so treat it as
|
|
826
|
+
* unknown rather than empty. Left out when X sent the text.
|
|
827
|
+
*/
|
|
828
|
+
unknownFields?: Array<'text'>;
|
|
829
|
+
|
|
782
830
|
/**
|
|
783
831
|
* User IDs that left this conversation.
|
|
784
832
|
*/
|
|
@@ -842,6 +890,7 @@ export namespace Error {
|
|
|
842
890
|
| 'account_not_found'
|
|
843
891
|
| 'account_required'
|
|
844
892
|
| 'account_restricted'
|
|
893
|
+
| 'api_key_budget_reached'
|
|
845
894
|
| 'api_key_limit_reached'
|
|
846
895
|
| 'article_not_found'
|
|
847
896
|
| 'closed'
|
|
@@ -1397,6 +1446,11 @@ export interface SearchTweet {
|
|
|
1397
1446
|
*/
|
|
1398
1447
|
limitedActions?: Array<SearchTweet.LimitedAction>;
|
|
1399
1448
|
|
|
1449
|
+
/**
|
|
1450
|
+
* The live event the post belongs to, such as an election.
|
|
1451
|
+
*/
|
|
1452
|
+
liveEventContext?: SearchTweet.LiveEventContext;
|
|
1453
|
+
|
|
1400
1454
|
/**
|
|
1401
1455
|
* Media, omitted when unavailable.
|
|
1402
1456
|
*/
|
|
@@ -1518,6 +1572,12 @@ export interface SearchTweet {
|
|
|
1518
1572
|
'retweetCount' | 'replyCount' | 'likeCount' | 'quoteCount' | 'viewCount' | 'bookmarkCount'
|
|
1519
1573
|
>;
|
|
1520
1574
|
|
|
1575
|
+
/**
|
|
1576
|
+
* The fields X did not send for this post. text reads empty, so treat it as
|
|
1577
|
+
* unknown rather than empty. Left out when X sent the text.
|
|
1578
|
+
*/
|
|
1579
|
+
unknownFields?: Array<'text'>;
|
|
1580
|
+
|
|
1521
1581
|
/**
|
|
1522
1582
|
* User IDs that left this conversation.
|
|
1523
1583
|
*/
|
|
@@ -2074,6 +2134,23 @@ export namespace SearchTweet {
|
|
|
2074
2134
|
}
|
|
2075
2135
|
}
|
|
2076
2136
|
|
|
2137
|
+
export interface LiveEventContext {
|
|
2138
|
+
/**
|
|
2139
|
+
* The event's image.
|
|
2140
|
+
*/
|
|
2141
|
+
imageUrl?: string;
|
|
2142
|
+
|
|
2143
|
+
/**
|
|
2144
|
+
* Event name.
|
|
2145
|
+
*/
|
|
2146
|
+
title?: string;
|
|
2147
|
+
|
|
2148
|
+
/**
|
|
2149
|
+
* The event's page on X.
|
|
2150
|
+
*/
|
|
2151
|
+
url?: string;
|
|
2152
|
+
}
|
|
2153
|
+
|
|
2077
2154
|
/**
|
|
2078
2155
|
* Complete Note Tweet content and rich-text metadata.
|
|
2079
2156
|
*/
|
|
@@ -2458,6 +2535,13 @@ export namespace SearchTweet {
|
|
|
2458
2535
|
* Public post & user this reaction references.
|
|
2459
2536
|
*/
|
|
2460
2537
|
export interface ReactionContext {
|
|
2538
|
+
/**
|
|
2539
|
+
* The post this one reacts to, with the same fields. X often sends only its
|
|
2540
|
+
* ID, author & edit history. Then unknownFields lists text, and the flags X
|
|
2541
|
+
* did not send are left out.
|
|
2542
|
+
*/
|
|
2543
|
+
reactedToPost?: { [key: string]: unknown };
|
|
2544
|
+
|
|
2461
2545
|
/**
|
|
2462
2546
|
* Referenced post ID.
|
|
2463
2547
|
*/
|
|
@@ -2793,6 +2877,12 @@ export interface TweetMedia {
|
|
|
2793
2877
|
*/
|
|
2794
2878
|
durationMillis?: number;
|
|
2795
2879
|
|
|
2880
|
+
/**
|
|
2881
|
+
* True when the author edited this media in X's own editor before posting.
|
|
2882
|
+
* Absent when X sends no editor info.
|
|
2883
|
+
*/
|
|
2884
|
+
editedWithNativeEditor?: boolean;
|
|
2885
|
+
|
|
2796
2886
|
/**
|
|
2797
2887
|
* Embeddable status.
|
|
2798
2888
|
*/
|
|
@@ -3359,6 +3449,12 @@ export namespace UserProfile {
|
|
|
3359
3449
|
* Organization affiliation label shown on an X profile.
|
|
3360
3450
|
*/
|
|
3361
3451
|
export interface AffiliatesHighlightedLabel {
|
|
3452
|
+
/**
|
|
3453
|
+
* More labels X shows beside the affiliation, such as an automated account's
|
|
3454
|
+
* owner.
|
|
3455
|
+
*/
|
|
3456
|
+
auxiliaryLabels?: Array<AffiliatesHighlightedLabel.AuxiliaryLabel>;
|
|
3457
|
+
|
|
3362
3458
|
badgeUrl?: string;
|
|
3363
3459
|
|
|
3364
3460
|
description?: string;
|
|
@@ -3377,6 +3473,23 @@ export namespace UserProfile {
|
|
|
3377
3473
|
userLabelType?: string;
|
|
3378
3474
|
}
|
|
3379
3475
|
|
|
3476
|
+
export namespace AffiliatesHighlightedLabel {
|
|
3477
|
+
/**
|
|
3478
|
+
* A label X shows on an X profile beside its affiliation label.
|
|
3479
|
+
*/
|
|
3480
|
+
export interface AuxiliaryLabel {
|
|
3481
|
+
badgeUrl?: string;
|
|
3482
|
+
|
|
3483
|
+
description?: string;
|
|
3484
|
+
|
|
3485
|
+
url?: string;
|
|
3486
|
+
|
|
3487
|
+
userLabelDisplayType?: string;
|
|
3488
|
+
|
|
3489
|
+
userLabelType?: string;
|
|
3490
|
+
}
|
|
3491
|
+
}
|
|
3492
|
+
|
|
3380
3493
|
/**
|
|
3381
3494
|
* The parts of the birthday the account made public.
|
|
3382
3495
|
*/
|
|
@@ -3,6 +3,7 @@
|
|
|
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
|
|
|
@@ -35,9 +36,21 @@ export interface SubscribeCreateResponse {
|
|
|
35
36
|
status: 'checkout_created' | 'already_subscribed' | 'payment_issue';
|
|
36
37
|
|
|
37
38
|
url: string;
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Currency the checkout charges. Only a checkout_created answer has it.
|
|
42
|
+
*/
|
|
43
|
+
chargedCurrency?: Shared.Currency;
|
|
38
44
|
}
|
|
39
45
|
|
|
40
46
|
export interface SubscribeCreateParams {
|
|
47
|
+
/**
|
|
48
|
+
* Currency to pay in, USD by default. Lowercase codes work too. Each renewal
|
|
49
|
+
* charges the same amount before tax. chargedCurrency shows the currency
|
|
50
|
+
* charged.
|
|
51
|
+
*/
|
|
52
|
+
currency?: Shared.Currency;
|
|
53
|
+
|
|
41
54
|
/**
|
|
42
55
|
* Subscription tier to pre-select.
|
|
43
56
|
*/
|
package/src/resources/x/index.ts
CHANGED
|
@@ -293,4 +293,22 @@ export {
|
|
|
293
293
|
type SportRetrieveScoreboardParams,
|
|
294
294
|
type SportRetrieveBoxScoreParams,
|
|
295
295
|
type SportRetrievePlaysParams,
|
|
296
|
+
type SportsTeamRecord,
|
|
297
|
+
type SportsTeamGame,
|
|
298
|
+
type SportsGameAudienceViewers,
|
|
299
|
+
type SportsGameAudienceTeamPick,
|
|
300
|
+
type SportsGameAudienceTeamPicks,
|
|
301
|
+
type SportsGameAudienceChatOpensIn,
|
|
302
|
+
type SportsGameAudienceChat,
|
|
303
|
+
type SportsGameAudience,
|
|
304
|
+
type SportRetrieveAudienceParams,
|
|
305
|
+
type FootballRosterTeam,
|
|
306
|
+
type FootballRoster,
|
|
307
|
+
type FootballPlayerProp,
|
|
308
|
+
type FootballPropCategory,
|
|
309
|
+
type FootballProps,
|
|
310
|
+
type SportsGamePosts,
|
|
311
|
+
type SportRetrieveRosterParams,
|
|
312
|
+
type SportRetrievePlayerPropsParams,
|
|
313
|
+
type SportListPostsParams,
|
|
296
314
|
} from './sports';
|
package/src/resources/x/media.ts
CHANGED
|
@@ -57,6 +57,11 @@ export interface MediaDownloadResponse {
|
|
|
57
57
|
|
|
58
58
|
galleryUrl?: string;
|
|
59
59
|
|
|
60
|
+
/**
|
|
61
|
+
* The post's files saved to your gallery. Single downloads only.
|
|
62
|
+
*/
|
|
63
|
+
items?: Array<MediaDownloadResponse.Item>;
|
|
64
|
+
|
|
60
65
|
totalMedia?: number;
|
|
61
66
|
|
|
62
67
|
totalTweets?: number;
|
|
@@ -64,6 +69,51 @@ export interface MediaDownloadResponse {
|
|
|
64
69
|
tweetId?: string;
|
|
65
70
|
}
|
|
66
71
|
|
|
72
|
+
export namespace MediaDownloadResponse {
|
|
73
|
+
/**
|
|
74
|
+
* 1 file saved to your gallery.
|
|
75
|
+
*/
|
|
76
|
+
export interface Item {
|
|
77
|
+
/**
|
|
78
|
+
* Gallery file ID.
|
|
79
|
+
*/
|
|
80
|
+
id: string;
|
|
81
|
+
|
|
82
|
+
tweetId: string;
|
|
83
|
+
|
|
84
|
+
mediaType: 'photo' | 'video' | 'animated_gif';
|
|
85
|
+
|
|
86
|
+
/**
|
|
87
|
+
* Saved copy of the file.
|
|
88
|
+
*/
|
|
89
|
+
mediaUrl: string;
|
|
90
|
+
|
|
91
|
+
/**
|
|
92
|
+
* File size in bytes, as a string.
|
|
93
|
+
*/
|
|
94
|
+
fileSize: string | null;
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* When the file joined your gallery.
|
|
98
|
+
*/
|
|
99
|
+
createdAt: string;
|
|
100
|
+
|
|
101
|
+
authorUsername: string;
|
|
102
|
+
|
|
103
|
+
authorDisplayName: string;
|
|
104
|
+
|
|
105
|
+
authorAvatar: string | null;
|
|
106
|
+
|
|
107
|
+
tweetText: string;
|
|
108
|
+
|
|
109
|
+
likes: number | null;
|
|
110
|
+
|
|
111
|
+
retweets: number | null;
|
|
112
|
+
|
|
113
|
+
views: number | null;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
67
117
|
/**
|
|
68
118
|
* Durable write record. Poll statusUrl until terminal is true. Reusing its
|
|
69
119
|
* Idempotency-Key returns this record. Create another action only when safeToRetry
|