x-twitter-scraper 0.1.0 → 0.2.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 +31 -0
- package/README.md +5 -5
- package/client.d.mts +2 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +2 -2
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/account.d.mts +19 -0
- package/resources/account.d.mts.map +1 -1
- package/resources/account.d.ts +19 -0
- package/resources/account.d.ts.map +1 -1
- package/resources/account.js +20 -1
- package/resources/account.js.map +1 -1
- package/resources/account.mjs +20 -1
- package/resources/account.mjs.map +1 -1
- package/resources/api-keys.d.mts +20 -0
- package/resources/api-keys.d.mts.map +1 -1
- package/resources/api-keys.d.ts +20 -0
- package/resources/api-keys.d.ts.map +1 -1
- package/resources/api-keys.js +20 -3
- package/resources/api-keys.js.map +1 -1
- package/resources/api-keys.mjs +20 -3
- package/resources/api-keys.mjs.map +1 -1
- package/resources/compose.d.mts +28 -3
- package/resources/compose.d.mts.map +1 -1
- package/resources/compose.d.ts +28 -3
- package/resources/compose.d.ts.map +1 -1
- package/resources/compose.js +9 -0
- package/resources/compose.js.map +1 -1
- package/resources/compose.mjs +9 -0
- package/resources/compose.mjs.map +1 -1
- package/resources/credits.d.mts +12 -0
- package/resources/credits.d.mts.map +1 -1
- package/resources/credits.d.ts +12 -0
- package/resources/credits.d.ts.map +1 -1
- package/resources/credits.js +12 -0
- package/resources/credits.js.map +1 -1
- package/resources/credits.mjs +12 -0
- package/resources/credits.mjs.map +1 -1
- package/resources/drafts.d.mts +33 -0
- package/resources/drafts.d.mts.map +1 -1
- package/resources/drafts.d.ts +33 -0
- package/resources/drafts.d.ts.map +1 -1
- package/resources/drafts.js +24 -0
- package/resources/drafts.js.map +1 -1
- package/resources/drafts.mjs +24 -0
- package/resources/drafts.mjs.map +1 -1
- package/resources/draws.d.mts +46 -1
- package/resources/draws.d.mts.map +1 -1
- package/resources/draws.d.ts +46 -1
- package/resources/draws.d.ts.map +1 -1
- package/resources/draws.js +27 -0
- package/resources/draws.js.map +1 -1
- package/resources/draws.mjs +27 -0
- package/resources/draws.mjs.map +1 -1
- package/resources/events.d.mts +25 -1
- package/resources/events.d.mts.map +1 -1
- package/resources/events.d.ts +25 -1
- package/resources/events.d.ts.map +1 -1
- package/resources/extractions.d.mts +74 -5
- package/resources/extractions.d.mts.map +1 -1
- package/resources/extractions.d.ts +74 -5
- package/resources/extractions.d.ts.map +1 -1
- package/resources/extractions.js +36 -0
- package/resources/extractions.js.map +1 -1
- package/resources/extractions.mjs +36 -0
- package/resources/extractions.mjs.map +1 -1
- package/resources/index.d.mts +1 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/integrations.d.mts +77 -0
- package/resources/integrations.d.mts.map +1 -1
- package/resources/integrations.d.ts +77 -0
- package/resources/integrations.d.ts.map +1 -1
- package/resources/integrations.js +47 -0
- package/resources/integrations.js.map +1 -1
- package/resources/integrations.mjs +47 -0
- package/resources/integrations.mjs.map +1 -1
- package/resources/monitors.d.mts +46 -0
- package/resources/monitors.d.mts.map +1 -1
- package/resources/monitors.d.ts +46 -0
- package/resources/monitors.d.ts.map +1 -1
- package/resources/monitors.js +31 -0
- package/resources/monitors.js.map +1 -1
- package/resources/monitors.mjs +31 -0
- package/resources/monitors.mjs.map +1 -1
- package/resources/radar.d.mts +4 -1
- package/resources/radar.d.mts.map +1 -1
- package/resources/radar.d.ts +4 -1
- package/resources/radar.d.ts.map +1 -1
- package/resources/shared.d.mts +12 -0
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +12 -0
- package/resources/shared.d.ts.map +1 -1
- package/resources/styles.d.mts +63 -4
- package/resources/styles.d.mts.map +1 -1
- package/resources/styles.d.ts +63 -4
- package/resources/styles.d.ts.map +1 -1
- package/resources/styles.js +55 -8
- package/resources/styles.js.map +1 -1
- package/resources/styles.mjs +55 -8
- package/resources/styles.mjs.map +1 -1
- package/resources/support/tickets.d.mts +34 -0
- package/resources/support/tickets.d.mts.map +1 -1
- package/resources/support/tickets.d.ts +34 -0
- package/resources/support/tickets.d.ts.map +1 -1
- package/resources/support/tickets.js +34 -0
- package/resources/support/tickets.js.map +1 -1
- package/resources/support/tickets.mjs +34 -0
- package/resources/support/tickets.mjs.map +1 -1
- package/resources/trends.d.mts +4 -1
- package/resources/trends.d.mts.map +1 -1
- package/resources/trends.d.ts +4 -1
- package/resources/trends.d.ts.map +1 -1
- package/resources/trends.js +1 -1
- package/resources/trends.mjs +1 -1
- package/resources/webhooks.d.mts +54 -0
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +54 -0
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.js +36 -0
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs +36 -0
- package/resources/webhooks.mjs.map +1 -1
- package/resources/x/accounts.d.mts +59 -3
- package/resources/x/accounts.d.mts.map +1 -1
- package/resources/x/accounts.d.ts +59 -3
- package/resources/x/accounts.d.ts.map +1 -1
- package/resources/x/accounts.js +55 -5
- package/resources/x/accounts.js.map +1 -1
- package/resources/x/accounts.mjs +55 -5
- package/resources/x/accounts.mjs.map +1 -1
- package/resources/x/bookmarks.d.mts +11 -1
- package/resources/x/bookmarks.d.mts.map +1 -1
- package/resources/x/bookmarks.d.ts +11 -1
- package/resources/x/bookmarks.d.ts.map +1 -1
- package/resources/x/bookmarks.js +10 -0
- package/resources/x/bookmarks.js.map +1 -1
- package/resources/x/bookmarks.mjs +10 -0
- package/resources/x/bookmarks.mjs.map +1 -1
- package/resources/x/communities/communities.d.mts +118 -11
- package/resources/x/communities/communities.d.mts.map +1 -1
- package/resources/x/communities/communities.d.ts +118 -11
- package/resources/x/communities/communities.d.ts.map +1 -1
- package/resources/x/communities/communities.js +45 -16
- package/resources/x/communities/communities.js.map +1 -1
- package/resources/x/communities/communities.mjs +45 -16
- package/resources/x/communities/communities.mjs.map +1 -1
- package/resources/x/communities/index.d.mts +1 -1
- package/resources/x/communities/index.d.mts.map +1 -1
- package/resources/x/communities/index.d.ts +1 -1
- package/resources/x/communities/index.d.ts.map +1 -1
- package/resources/x/communities/index.js.map +1 -1
- package/resources/x/communities/index.mjs.map +1 -1
- package/resources/x/communities/join.d.mts +18 -2
- package/resources/x/communities/join.d.mts.map +1 -1
- package/resources/x/communities/join.d.ts +18 -2
- package/resources/x/communities/join.d.ts.map +1 -1
- package/resources/x/communities/join.js +16 -0
- package/resources/x/communities/join.js.map +1 -1
- package/resources/x/communities/join.mjs +16 -0
- package/resources/x/communities/join.mjs.map +1 -1
- package/resources/x/communities/tweets.d.mts +28 -5
- package/resources/x/communities/tweets.d.mts.map +1 -1
- package/resources/x/communities/tweets.d.ts +28 -5
- package/resources/x/communities/tweets.d.ts.map +1 -1
- package/resources/x/communities/tweets.js +20 -6
- package/resources/x/communities/tweets.js.map +1 -1
- package/resources/x/communities/tweets.mjs +20 -6
- package/resources/x/communities/tweets.mjs.map +1 -1
- package/resources/x/dm.d.mts +19 -2
- package/resources/x/dm.d.mts.map +1 -1
- package/resources/x/dm.d.ts +19 -2
- package/resources/x/dm.d.ts.map +1 -1
- package/resources/x/dm.js +17 -0
- package/resources/x/dm.js.map +1 -1
- package/resources/x/dm.mjs +17 -0
- package/resources/x/dm.mjs.map +1 -1
- package/resources/x/followers.d.mts +8 -0
- package/resources/x/followers.d.mts.map +1 -1
- package/resources/x/followers.d.ts +8 -0
- package/resources/x/followers.d.ts.map +1 -1
- package/resources/x/followers.js +8 -0
- package/resources/x/followers.js.map +1 -1
- package/resources/x/followers.mjs +8 -0
- package/resources/x/followers.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/lists.d.mts +27 -6
- package/resources/x/lists.d.mts.map +1 -1
- package/resources/x/lists.d.ts +27 -6
- package/resources/x/lists.d.ts.map +1 -1
- package/resources/x/lists.js +23 -16
- package/resources/x/lists.js.map +1 -1
- package/resources/x/lists.mjs +23 -16
- package/resources/x/lists.mjs.map +1 -1
- package/resources/x/media.d.mts +17 -1
- package/resources/x/media.d.mts.map +1 -1
- package/resources/x/media.d.ts +17 -1
- package/resources/x/media.d.ts.map +1 -1
- package/resources/x/media.js +16 -0
- package/resources/x/media.js.map +1 -1
- package/resources/x/media.mjs +16 -0
- package/resources/x/media.mjs.map +1 -1
- package/resources/x/profile.d.mts +30 -3
- package/resources/x/profile.d.mts.map +1 -1
- package/resources/x/profile.d.ts +30 -3
- package/resources/x/profile.d.ts.map +1 -1
- package/resources/x/profile.js +27 -0
- package/resources/x/profile.js.map +1 -1
- package/resources/x/profile.mjs +27 -0
- package/resources/x/profile.mjs.map +1 -1
- package/resources/x/tweets/like.d.mts +18 -4
- package/resources/x/tweets/like.d.mts.map +1 -1
- package/resources/x/tweets/like.d.ts +18 -4
- package/resources/x/tweets/like.d.ts.map +1 -1
- package/resources/x/tweets/like.js +18 -4
- package/resources/x/tweets/like.js.map +1 -1
- package/resources/x/tweets/like.mjs +18 -4
- package/resources/x/tweets/like.mjs.map +1 -1
- package/resources/x/tweets/retweet.d.mts +18 -4
- package/resources/x/tweets/retweet.d.mts.map +1 -1
- package/resources/x/tweets/retweet.d.ts +18 -4
- package/resources/x/tweets/retweet.d.ts.map +1 -1
- package/resources/x/tweets/retweet.js +18 -4
- package/resources/x/tweets/retweet.js.map +1 -1
- package/resources/x/tweets/retweet.mjs +18 -4
- package/resources/x/tweets/retweet.mjs.map +1 -1
- package/resources/x/tweets/tweets.d.mts +146 -15
- package/resources/x/tweets/tweets.d.mts.map +1 -1
- package/resources/x/tweets/tweets.d.ts +146 -15
- package/resources/x/tweets/tweets.d.ts.map +1 -1
- package/resources/x/tweets/tweets.js +74 -10
- package/resources/x/tweets/tweets.js.map +1 -1
- package/resources/x/tweets/tweets.mjs +74 -10
- package/resources/x/tweets/tweets.mjs.map +1 -1
- package/resources/x/users/follow.d.mts +19 -4
- package/resources/x/users/follow.d.mts.map +1 -1
- package/resources/x/users/follow.d.ts +19 -4
- package/resources/x/users/follow.d.ts.map +1 -1
- package/resources/x/users/follow.js +19 -4
- package/resources/x/users/follow.js.map +1 -1
- package/resources/x/users/follow.mjs +19 -4
- package/resources/x/users/follow.mjs.map +1 -1
- package/resources/x/users/users.d.mts +94 -21
- package/resources/x/users/users.d.mts.map +1 -1
- package/resources/x/users/users.d.ts +94 -21
- package/resources/x/users/users.d.ts.map +1 -1
- package/resources/x/users/users.js +78 -33
- package/resources/x/users/users.js.map +1 -1
- package/resources/x/users/users.mjs +78 -33
- package/resources/x/users/users.mjs.map +1 -1
- package/resources/x/x.d.mts +42 -6
- package/resources/x/x.d.mts.map +1 -1
- package/resources/x/x.d.ts +42 -6
- package/resources/x/x.d.ts.map +1 -1
- package/resources/x/x.js +21 -5
- package/resources/x/x.js.map +1 -1
- package/resources/x/x.mjs +21 -5
- package/resources/x/x.mjs.map +1 -1
- package/src/client.ts +2 -0
- package/src/resources/account.ts +20 -1
- package/src/resources/api-keys.ts +23 -3
- package/src/resources/compose.ts +32 -1
- package/src/resources/credits.ts +12 -0
- package/src/resources/drafts.ts +33 -0
- package/src/resources/draws.ts +46 -1
- package/src/resources/events.ts +25 -1
- package/src/resources/extractions.ts +74 -5
- package/src/resources/index.ts +1 -0
- package/src/resources/integrations.ts +77 -0
- package/src/resources/monitors.ts +46 -0
- package/src/resources/radar.ts +4 -1
- package/src/resources/shared.ts +12 -0
- package/src/resources/styles.ts +67 -8
- package/src/resources/support/tickets.ts +34 -0
- package/src/resources/trends.ts +4 -1
- package/src/resources/webhooks.ts +54 -0
- package/src/resources/x/accounts.ts +72 -7
- package/src/resources/x/bookmarks.ts +11 -1
- package/src/resources/x/communities/communities.ts +142 -26
- package/src/resources/x/communities/index.ts +1 -1
- package/src/resources/x/communities/join.ts +18 -2
- package/src/resources/x/communities/tweets.ts +41 -11
- package/src/resources/x/dm.ts +19 -2
- package/src/resources/x/followers.ts +8 -0
- package/src/resources/x/index.ts +2 -0
- package/src/resources/x/lists.ts +30 -22
- package/src/resources/x/media.ts +17 -1
- package/src/resources/x/profile.ts +30 -3
- package/src/resources/x/tweets/like.ts +20 -6
- package/src/resources/x/tweets/retweet.ts +20 -14
- package/src/resources/x/tweets/tweets.ts +157 -27
- package/src/resources/x/users/follow.ts +21 -10
- package/src/resources/x/users/users.ts +103 -52
- package/src/resources/x/x.ts +50 -8
- 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
|
@@ -11,16 +11,30 @@ import { path } from '../../../internal/utils/path';
|
|
|
11
11
|
export class Like extends APIResource {
|
|
12
12
|
/**
|
|
13
13
|
* Like tweet
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const like = await client.x.tweets.like.create('id', {
|
|
18
|
+
* account: '@elonmusk',
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
14
21
|
*/
|
|
15
|
-
create(
|
|
16
|
-
return this._client.post(path`/x/tweets/${
|
|
22
|
+
create(id: string, body: LikeCreateParams, options?: RequestOptions): APIPromise<LikeCreateResponse> {
|
|
23
|
+
return this._client.post(path`/x/tweets/${id}/like`, { body, ...options });
|
|
17
24
|
}
|
|
18
25
|
|
|
19
26
|
/**
|
|
20
27
|
* Unlike tweet
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* const like = await client.x.tweets.like.delete('id', {
|
|
32
|
+
* account: '@elonmusk',
|
|
33
|
+
* });
|
|
34
|
+
* ```
|
|
21
35
|
*/
|
|
22
|
-
delete(
|
|
23
|
-
return this._client.delete(path`/x/tweets/${
|
|
36
|
+
delete(id: string, body: LikeDeleteParams, options?: RequestOptions): APIPromise<LikeDeleteResponse> {
|
|
37
|
+
return this._client.delete(path`/x/tweets/${id}/like`, { body, ...options });
|
|
24
38
|
}
|
|
25
39
|
}
|
|
26
40
|
|
|
@@ -34,14 +48,14 @@ export interface LikeDeleteResponse {
|
|
|
34
48
|
|
|
35
49
|
export interface LikeCreateParams {
|
|
36
50
|
/**
|
|
37
|
-
* X account (@username or account ID)
|
|
51
|
+
* X account identifier (@username or account ID)
|
|
38
52
|
*/
|
|
39
53
|
account: string;
|
|
40
54
|
}
|
|
41
55
|
|
|
42
56
|
export interface LikeDeleteParams {
|
|
43
57
|
/**
|
|
44
|
-
* X account (@username or account ID)
|
|
58
|
+
* X account identifier (@username or account ID)
|
|
45
59
|
*/
|
|
46
60
|
account: string;
|
|
47
61
|
}
|
|
@@ -11,24 +11,30 @@ import { path } from '../../../internal/utils/path';
|
|
|
11
11
|
export class Retweet extends APIResource {
|
|
12
12
|
/**
|
|
13
13
|
* Retweet
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const retweet = await client.x.tweets.retweet.create('id', {
|
|
18
|
+
* account: '@elonmusk',
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
14
21
|
*/
|
|
15
|
-
create(
|
|
16
|
-
|
|
17
|
-
body: RetweetCreateParams,
|
|
18
|
-
options?: RequestOptions,
|
|
19
|
-
): APIPromise<RetweetCreateResponse> {
|
|
20
|
-
return this._client.post(path`/x/tweets/${tweetID}/retweet`, { body, ...options });
|
|
22
|
+
create(id: string, body: RetweetCreateParams, options?: RequestOptions): APIPromise<RetweetCreateResponse> {
|
|
23
|
+
return this._client.post(path`/x/tweets/${id}/retweet`, { body, ...options });
|
|
21
24
|
}
|
|
22
25
|
|
|
23
26
|
/**
|
|
24
27
|
* Unretweet
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* const retweet = await client.x.tweets.retweet.delete('id', {
|
|
32
|
+
* account: '@elonmusk',
|
|
33
|
+
* });
|
|
34
|
+
* ```
|
|
25
35
|
*/
|
|
26
|
-
delete(
|
|
27
|
-
|
|
28
|
-
body: RetweetDeleteParams,
|
|
29
|
-
options?: RequestOptions,
|
|
30
|
-
): APIPromise<RetweetDeleteResponse> {
|
|
31
|
-
return this._client.delete(path`/x/tweets/${tweetID}/retweet`, { body, ...options });
|
|
36
|
+
delete(id: string, body: RetweetDeleteParams, options?: RequestOptions): APIPromise<RetweetDeleteResponse> {
|
|
37
|
+
return this._client.delete(path`/x/tweets/${id}/retweet`, { body, ...options });
|
|
32
38
|
}
|
|
33
39
|
}
|
|
34
40
|
|
|
@@ -42,14 +48,14 @@ export interface RetweetDeleteResponse {
|
|
|
42
48
|
|
|
43
49
|
export interface RetweetCreateParams {
|
|
44
50
|
/**
|
|
45
|
-
* X account (@username or account ID)
|
|
51
|
+
* X account identifier (@username or account ID)
|
|
46
52
|
*/
|
|
47
53
|
account: string;
|
|
48
54
|
}
|
|
49
55
|
|
|
50
56
|
export interface RetweetDeleteParams {
|
|
51
57
|
/**
|
|
52
|
-
* X account (@username or account ID)
|
|
58
|
+
* X account identifier (@username or account ID)
|
|
53
59
|
*/
|
|
54
60
|
account: string;
|
|
55
61
|
}
|
|
@@ -13,7 +13,6 @@ import {
|
|
|
13
13
|
RetweetDeleteResponse,
|
|
14
14
|
} from './retweet';
|
|
15
15
|
import { APIPromise } from '../../../core/api-promise';
|
|
16
|
-
import { buildHeaders } from '../../../internal/headers';
|
|
17
16
|
import { RequestOptions } from '../../../internal/request-options';
|
|
18
17
|
import { path } from '../../../internal/utils/path';
|
|
19
18
|
|
|
@@ -23,6 +22,14 @@ export class Tweets extends APIResource {
|
|
|
23
22
|
|
|
24
23
|
/**
|
|
25
24
|
* Create tweet
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* const tweet = await client.x.tweets.create({
|
|
29
|
+
* account: '@elonmusk',
|
|
30
|
+
* text: 'Just launched our new feature!',
|
|
31
|
+
* });
|
|
32
|
+
* ```
|
|
26
33
|
*/
|
|
27
34
|
create(body: TweetCreateParams, options?: RequestOptions): APIPromise<TweetCreateResponse> {
|
|
28
35
|
return this._client.post('/x/tweets', { body, ...options });
|
|
@@ -30,35 +37,53 @@ export class Tweets extends APIResource {
|
|
|
30
37
|
|
|
31
38
|
/**
|
|
32
39
|
* Look up tweet
|
|
40
|
+
*
|
|
41
|
+
* @example
|
|
42
|
+
* ```ts
|
|
43
|
+
* const tweet = await client.x.tweets.retrieve('id');
|
|
44
|
+
* ```
|
|
33
45
|
*/
|
|
34
|
-
retrieve(
|
|
35
|
-
return this._client.get(path`/x/tweets/${
|
|
46
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<TweetRetrieveResponse> {
|
|
47
|
+
return this._client.get(path`/x/tweets/${id}`, options);
|
|
36
48
|
}
|
|
37
49
|
|
|
38
50
|
/**
|
|
39
51
|
* Get multiple tweets by IDs
|
|
52
|
+
*
|
|
53
|
+
* @example
|
|
54
|
+
* ```ts
|
|
55
|
+
* const paginatedTweets = await client.x.tweets.list({
|
|
56
|
+
* ids: 'ids',
|
|
57
|
+
* });
|
|
58
|
+
* ```
|
|
40
59
|
*/
|
|
41
|
-
list(query: TweetListParams, options?: RequestOptions): APIPromise<
|
|
42
|
-
return this._client.get('/x/tweets', {
|
|
43
|
-
query,
|
|
44
|
-
...options,
|
|
45
|
-
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
46
|
-
});
|
|
60
|
+
list(query: TweetListParams, options?: RequestOptions): APIPromise<Shared.PaginatedTweets> {
|
|
61
|
+
return this._client.get('/x/tweets', { query, ...options });
|
|
47
62
|
}
|
|
48
63
|
|
|
49
64
|
/**
|
|
50
65
|
* Delete tweet
|
|
66
|
+
*
|
|
67
|
+
* @example
|
|
68
|
+
* ```ts
|
|
69
|
+
* const tweet = await client.x.tweets.delete('id', {
|
|
70
|
+
* account: '@elonmusk',
|
|
71
|
+
* });
|
|
72
|
+
* ```
|
|
51
73
|
*/
|
|
52
|
-
delete(
|
|
53
|
-
|
|
54
|
-
body: TweetDeleteParams,
|
|
55
|
-
options?: RequestOptions,
|
|
56
|
-
): APIPromise<TweetDeleteResponse> {
|
|
57
|
-
return this._client.delete(path`/x/tweets/${tweetID}`, { body, ...options });
|
|
74
|
+
delete(id: string, body: TweetDeleteParams, options?: RequestOptions): APIPromise<TweetDeleteResponse> {
|
|
75
|
+
return this._client.delete(path`/x/tweets/${id}`, { body, ...options });
|
|
58
76
|
}
|
|
59
77
|
|
|
60
78
|
/**
|
|
61
79
|
* Get users who liked a tweet
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```ts
|
|
83
|
+
* const paginatedUsers = await client.x.tweets.getFavoriters(
|
|
84
|
+
* 'id',
|
|
85
|
+
* );
|
|
86
|
+
* ```
|
|
62
87
|
*/
|
|
63
88
|
getFavoriters(
|
|
64
89
|
id: string,
|
|
@@ -70,6 +95,13 @@ export class Tweets extends APIResource {
|
|
|
70
95
|
|
|
71
96
|
/**
|
|
72
97
|
* Get quote tweets of a tweet
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```ts
|
|
101
|
+
* const paginatedTweets = await client.x.tweets.getQuotes(
|
|
102
|
+
* 'id',
|
|
103
|
+
* );
|
|
104
|
+
* ```
|
|
73
105
|
*/
|
|
74
106
|
getQuotes(
|
|
75
107
|
id: string,
|
|
@@ -81,6 +113,13 @@ export class Tweets extends APIResource {
|
|
|
81
113
|
|
|
82
114
|
/**
|
|
83
115
|
* Get replies to a tweet
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* ```ts
|
|
119
|
+
* const paginatedTweets = await client.x.tweets.getReplies(
|
|
120
|
+
* 'id',
|
|
121
|
+
* );
|
|
122
|
+
* ```
|
|
84
123
|
*/
|
|
85
124
|
getReplies(
|
|
86
125
|
id: string,
|
|
@@ -92,6 +131,13 @@ export class Tweets extends APIResource {
|
|
|
92
131
|
|
|
93
132
|
/**
|
|
94
133
|
* Get users who retweeted a tweet
|
|
134
|
+
*
|
|
135
|
+
* @example
|
|
136
|
+
* ```ts
|
|
137
|
+
* const paginatedUsers = await client.x.tweets.getRetweeters(
|
|
138
|
+
* 'id',
|
|
139
|
+
* );
|
|
140
|
+
* ```
|
|
95
141
|
*/
|
|
96
142
|
getRetweeters(
|
|
97
143
|
id: string,
|
|
@@ -103,6 +149,13 @@ export class Tweets extends APIResource {
|
|
|
103
149
|
|
|
104
150
|
/**
|
|
105
151
|
* Get thread context for a tweet
|
|
152
|
+
*
|
|
153
|
+
* @example
|
|
154
|
+
* ```ts
|
|
155
|
+
* const paginatedTweets = await client.x.tweets.getThread(
|
|
156
|
+
* 'id',
|
|
157
|
+
* );
|
|
158
|
+
* ```
|
|
106
159
|
*/
|
|
107
160
|
getThread(
|
|
108
161
|
id: string,
|
|
@@ -114,12 +167,22 @@ export class Tweets extends APIResource {
|
|
|
114
167
|
|
|
115
168
|
/**
|
|
116
169
|
* Search tweets
|
|
170
|
+
*
|
|
171
|
+
* @example
|
|
172
|
+
* ```ts
|
|
173
|
+
* const paginatedTweets = await client.x.tweets.search({
|
|
174
|
+
* q: 'q',
|
|
175
|
+
* });
|
|
176
|
+
* ```
|
|
117
177
|
*/
|
|
118
178
|
search(query: TweetSearchParams, options?: RequestOptions): APIPromise<Shared.PaginatedTweets> {
|
|
119
179
|
return this._client.get('/x/tweets/search', { query, ...options });
|
|
120
180
|
}
|
|
121
181
|
}
|
|
122
182
|
|
|
183
|
+
/**
|
|
184
|
+
* Tweet returned from search results with inline author info.
|
|
185
|
+
*/
|
|
123
186
|
export interface SearchTweet {
|
|
124
187
|
id: string;
|
|
125
188
|
|
|
@@ -131,6 +194,11 @@ export interface SearchTweet {
|
|
|
131
194
|
|
|
132
195
|
createdAt?: string;
|
|
133
196
|
|
|
197
|
+
/**
|
|
198
|
+
* True for Note Tweets (long-form content, up to 25,000 characters)
|
|
199
|
+
*/
|
|
200
|
+
isNoteTweet?: boolean;
|
|
201
|
+
|
|
134
202
|
likeCount?: number;
|
|
135
203
|
|
|
136
204
|
quoteCount?: number;
|
|
@@ -154,6 +222,9 @@ export namespace SearchTweet {
|
|
|
154
222
|
}
|
|
155
223
|
}
|
|
156
224
|
|
|
225
|
+
/**
|
|
226
|
+
* Author of a tweet with follower count and verification status.
|
|
227
|
+
*/
|
|
157
228
|
export interface TweetAuthor {
|
|
158
229
|
id: string;
|
|
159
230
|
|
|
@@ -166,6 +237,9 @@ export interface TweetAuthor {
|
|
|
166
237
|
profilePicture?: string;
|
|
167
238
|
}
|
|
168
239
|
|
|
240
|
+
/**
|
|
241
|
+
* Full tweet with text, engagement metrics, media, and metadata.
|
|
242
|
+
*/
|
|
169
243
|
export interface TweetDetail {
|
|
170
244
|
id: string;
|
|
171
245
|
|
|
@@ -183,7 +257,57 @@ export interface TweetDetail {
|
|
|
183
257
|
|
|
184
258
|
viewCount: number;
|
|
185
259
|
|
|
260
|
+
/**
|
|
261
|
+
* ID of the root tweet in the conversation thread
|
|
262
|
+
*/
|
|
263
|
+
conversationId?: string;
|
|
264
|
+
|
|
186
265
|
createdAt?: string;
|
|
266
|
+
|
|
267
|
+
/**
|
|
268
|
+
* Parsed entities from the tweet text (URLs, mentions, hashtags, media)
|
|
269
|
+
*/
|
|
270
|
+
entities?: { [key: string]: unknown };
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Whether this is a Note Tweet (long-form post, up to 25,000 characters)
|
|
274
|
+
*/
|
|
275
|
+
isNoteTweet?: boolean;
|
|
276
|
+
|
|
277
|
+
/**
|
|
278
|
+
* Whether this tweet quotes another tweet
|
|
279
|
+
*/
|
|
280
|
+
isQuoteStatus?: boolean;
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Whether this tweet is a reply to another tweet
|
|
284
|
+
*/
|
|
285
|
+
isReply?: boolean;
|
|
286
|
+
|
|
287
|
+
/**
|
|
288
|
+
* Attached media items, omitted when the tweet has no media
|
|
289
|
+
*/
|
|
290
|
+
media?: Array<TweetDetail.Media>;
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* The quoted tweet object, present when isQuoteStatus is true
|
|
294
|
+
*/
|
|
295
|
+
quoted_tweet?: { [key: string]: unknown };
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* Client application used to post this tweet
|
|
299
|
+
*/
|
|
300
|
+
source?: string;
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
export namespace TweetDetail {
|
|
304
|
+
export interface Media {
|
|
305
|
+
mediaUrl?: string;
|
|
306
|
+
|
|
307
|
+
type?: 'photo' | 'video' | 'animated_gif';
|
|
308
|
+
|
|
309
|
+
url?: string;
|
|
310
|
+
}
|
|
187
311
|
}
|
|
188
312
|
|
|
189
313
|
export interface TweetCreateResponse {
|
|
@@ -193,8 +317,14 @@ export interface TweetCreateResponse {
|
|
|
193
317
|
}
|
|
194
318
|
|
|
195
319
|
export interface TweetRetrieveResponse {
|
|
320
|
+
/**
|
|
321
|
+
* Full tweet with text, engagement metrics, media, and metadata.
|
|
322
|
+
*/
|
|
196
323
|
tweet: TweetDetail;
|
|
197
324
|
|
|
325
|
+
/**
|
|
326
|
+
* Author of a tweet with follower count and verification status.
|
|
327
|
+
*/
|
|
198
328
|
author?: TweetAuthor;
|
|
199
329
|
}
|
|
200
330
|
|
|
@@ -230,67 +360,67 @@ export interface TweetListParams {
|
|
|
230
360
|
|
|
231
361
|
export interface TweetDeleteParams {
|
|
232
362
|
/**
|
|
233
|
-
* X account (@username or account ID)
|
|
363
|
+
* X account identifier (@username or account ID)
|
|
234
364
|
*/
|
|
235
365
|
account: string;
|
|
236
366
|
}
|
|
237
367
|
|
|
238
368
|
export interface TweetGetFavoritersParams {
|
|
239
369
|
/**
|
|
240
|
-
* Pagination cursor
|
|
370
|
+
* Pagination cursor for favoriters
|
|
241
371
|
*/
|
|
242
372
|
cursor?: string;
|
|
243
373
|
}
|
|
244
374
|
|
|
245
375
|
export interface TweetGetQuotesParams {
|
|
246
376
|
/**
|
|
247
|
-
* Pagination cursor
|
|
377
|
+
* Pagination cursor for quote tweets
|
|
248
378
|
*/
|
|
249
379
|
cursor?: string;
|
|
250
380
|
|
|
251
381
|
/**
|
|
252
|
-
* Include
|
|
382
|
+
* Include reply quotes (default false)
|
|
253
383
|
*/
|
|
254
384
|
includeReplies?: boolean;
|
|
255
385
|
|
|
256
386
|
/**
|
|
257
|
-
* Unix timestamp -
|
|
387
|
+
* Unix timestamp - return quotes posted after this time
|
|
258
388
|
*/
|
|
259
389
|
sinceTime?: string;
|
|
260
390
|
|
|
261
391
|
/**
|
|
262
|
-
* Unix timestamp -
|
|
392
|
+
* Unix timestamp - return quotes posted before this time
|
|
263
393
|
*/
|
|
264
394
|
untilTime?: string;
|
|
265
395
|
}
|
|
266
396
|
|
|
267
397
|
export interface TweetGetRepliesParams {
|
|
268
398
|
/**
|
|
269
|
-
* Pagination cursor
|
|
399
|
+
* Pagination cursor for tweet replies
|
|
270
400
|
*/
|
|
271
401
|
cursor?: string;
|
|
272
402
|
|
|
273
403
|
/**
|
|
274
|
-
* Unix timestamp -
|
|
404
|
+
* Unix timestamp - return replies posted after this time
|
|
275
405
|
*/
|
|
276
406
|
sinceTime?: string;
|
|
277
407
|
|
|
278
408
|
/**
|
|
279
|
-
* Unix timestamp -
|
|
409
|
+
* Unix timestamp - return replies posted before this time
|
|
280
410
|
*/
|
|
281
411
|
untilTime?: string;
|
|
282
412
|
}
|
|
283
413
|
|
|
284
414
|
export interface TweetGetRetweetersParams {
|
|
285
415
|
/**
|
|
286
|
-
* Pagination cursor
|
|
416
|
+
* Pagination cursor for retweeters
|
|
287
417
|
*/
|
|
288
418
|
cursor?: string;
|
|
289
419
|
}
|
|
290
420
|
|
|
291
421
|
export interface TweetGetThreadParams {
|
|
292
422
|
/**
|
|
293
|
-
* Pagination cursor
|
|
423
|
+
* Pagination cursor for thread tweets
|
|
294
424
|
*/
|
|
295
425
|
cursor?: string;
|
|
296
426
|
}
|
|
@@ -307,7 +437,7 @@ export interface TweetSearchParams {
|
|
|
307
437
|
cursor?: string;
|
|
308
438
|
|
|
309
439
|
/**
|
|
310
|
-
*
|
|
440
|
+
* Max tweets to return (server paginates internally). Omit for single page (~20).
|
|
311
441
|
*/
|
|
312
442
|
limit?: number;
|
|
313
443
|
|
|
@@ -11,24 +11,35 @@ import { path } from '../../../internal/utils/path';
|
|
|
11
11
|
export class Follow extends APIResource {
|
|
12
12
|
/**
|
|
13
13
|
* Follow user
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const follow = await client.x.users.follow.create('id', {
|
|
18
|
+
* account: '@elonmusk',
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
14
21
|
*/
|
|
15
|
-
create(
|
|
16
|
-
|
|
17
|
-
body: FollowCreateParams,
|
|
18
|
-
options?: RequestOptions,
|
|
19
|
-
): APIPromise<FollowCreateResponse> {
|
|
20
|
-
return this._client.post(path`/x/users/${userID}/follow`, { body, ...options });
|
|
22
|
+
create(id: string, body: FollowCreateParams, options?: RequestOptions): APIPromise<FollowCreateResponse> {
|
|
23
|
+
return this._client.post(path`/x/users/${id}/follow`, { body, ...options });
|
|
21
24
|
}
|
|
22
25
|
|
|
23
26
|
/**
|
|
24
27
|
* Unfollow user
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* const response = await client.x.users.follow.deleteAll(
|
|
32
|
+
* 'id',
|
|
33
|
+
* { account: '@elonmusk' },
|
|
34
|
+
* );
|
|
35
|
+
* ```
|
|
25
36
|
*/
|
|
26
37
|
deleteAll(
|
|
27
|
-
|
|
38
|
+
id: string,
|
|
28
39
|
body: FollowDeleteAllParams,
|
|
29
40
|
options?: RequestOptions,
|
|
30
41
|
): APIPromise<FollowDeleteAllResponse> {
|
|
31
|
-
return this._client.delete(path`/x/users/${
|
|
42
|
+
return this._client.delete(path`/x/users/${id}/follow`, { body, ...options });
|
|
32
43
|
}
|
|
33
44
|
}
|
|
34
45
|
|
|
@@ -42,14 +53,14 @@ export interface FollowDeleteAllResponse {
|
|
|
42
53
|
|
|
43
54
|
export interface FollowCreateParams {
|
|
44
55
|
/**
|
|
45
|
-
* X account (@username or account ID)
|
|
56
|
+
* X account identifier (@username or account ID)
|
|
46
57
|
*/
|
|
47
58
|
account: string;
|
|
48
59
|
}
|
|
49
60
|
|
|
50
61
|
export interface FollowDeleteAllParams {
|
|
51
62
|
/**
|
|
52
|
-
* X account (@username or account ID)
|
|
63
|
+
* X account identifier (@username or account ID)
|
|
53
64
|
*/
|
|
54
65
|
account: string;
|
|
55
66
|
}
|