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
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import * as Shared from '../../shared';
|
|
4
5
|
import * as JoinAPI from './join';
|
|
5
6
|
import { Join, JoinCreateParams, JoinDeleteAllParams } from './join';
|
|
6
7
|
import * as TweetsAPI from './tweets';
|
|
7
|
-
import { TweetListParams, Tweets } from './tweets';
|
|
8
|
+
import { TweetListByCommunityParams, TweetListParams, Tweets } from './tweets';
|
|
8
9
|
import { APIPromise } from '../../../core/api-promise';
|
|
9
|
-
import { buildHeaders } from '../../../internal/headers';
|
|
10
10
|
import { RequestOptions } from '../../../internal/request-options';
|
|
11
11
|
import { path } from '../../../internal/utils/path';
|
|
12
12
|
|
|
@@ -16,6 +16,15 @@ export class Communities extends APIResource {
|
|
|
16
16
|
|
|
17
17
|
/**
|
|
18
18
|
* Create community
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* const community = await client.x.communities.create({
|
|
23
|
+
* account: '@elonmusk',
|
|
24
|
+
* name: 'Example Name',
|
|
25
|
+
* description: 'A community for Tesla enthusiasts',
|
|
26
|
+
* });
|
|
27
|
+
* ```
|
|
19
28
|
*/
|
|
20
29
|
create(body: CommunityCreateParams, options?: RequestOptions): APIPromise<CommunityCreateResponse> {
|
|
21
30
|
return this._client.post('/x/communities', { body, ...options });
|
|
@@ -23,6 +32,14 @@ export class Communities extends APIResource {
|
|
|
23
32
|
|
|
24
33
|
/**
|
|
25
34
|
* Delete community
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* const community = await client.x.communities.delete('id', {
|
|
39
|
+
* account: '@elonmusk',
|
|
40
|
+
* community_name: 'Tesla Fans',
|
|
41
|
+
* });
|
|
42
|
+
* ```
|
|
26
43
|
*/
|
|
27
44
|
delete(
|
|
28
45
|
id: string,
|
|
@@ -34,6 +51,13 @@ export class Communities extends APIResource {
|
|
|
34
51
|
|
|
35
52
|
/**
|
|
36
53
|
* Get community details
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* const response = await client.x.communities.retrieveInfo(
|
|
58
|
+
* 'id',
|
|
59
|
+
* );
|
|
60
|
+
* ```
|
|
37
61
|
*/
|
|
38
62
|
retrieveInfo(id: string, options?: RequestOptions): APIPromise<CommunityRetrieveInfoResponse> {
|
|
39
63
|
return this._client.get(path`/x/communities/${id}/info`, options);
|
|
@@ -41,46 +65,58 @@ export class Communities extends APIResource {
|
|
|
41
65
|
|
|
42
66
|
/**
|
|
43
67
|
* Get community members
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```ts
|
|
71
|
+
* const paginatedUsers =
|
|
72
|
+
* await client.x.communities.retrieveMembers('id');
|
|
73
|
+
* ```
|
|
44
74
|
*/
|
|
45
75
|
retrieveMembers(
|
|
46
76
|
id: string,
|
|
47
77
|
query: CommunityRetrieveMembersParams | null | undefined = {},
|
|
48
78
|
options?: RequestOptions,
|
|
49
|
-
): APIPromise<
|
|
50
|
-
return this._client.get(path`/x/communities/${id}/members`, {
|
|
51
|
-
query,
|
|
52
|
-
...options,
|
|
53
|
-
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
54
|
-
});
|
|
79
|
+
): APIPromise<Shared.PaginatedUsers> {
|
|
80
|
+
return this._client.get(path`/x/communities/${id}/members`, { query, ...options });
|
|
55
81
|
}
|
|
56
82
|
|
|
57
83
|
/**
|
|
58
84
|
* Get community moderators
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```ts
|
|
88
|
+
* const paginatedUsers =
|
|
89
|
+
* await client.x.communities.retrieveModerators('id');
|
|
90
|
+
* ```
|
|
59
91
|
*/
|
|
60
92
|
retrieveModerators(
|
|
61
93
|
id: string,
|
|
62
94
|
query: CommunityRetrieveModeratorsParams | null | undefined = {},
|
|
63
95
|
options?: RequestOptions,
|
|
64
|
-
): APIPromise<
|
|
65
|
-
return this._client.get(path`/x/communities/${id}/moderators`, {
|
|
66
|
-
query,
|
|
67
|
-
...options,
|
|
68
|
-
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
69
|
-
});
|
|
96
|
+
): APIPromise<Shared.PaginatedUsers> {
|
|
97
|
+
return this._client.get(path`/x/communities/${id}/moderators`, { query, ...options });
|
|
70
98
|
}
|
|
71
99
|
|
|
72
100
|
/**
|
|
73
101
|
* Search tweets across communities
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```ts
|
|
105
|
+
* const paginatedTweets =
|
|
106
|
+
* await client.x.communities.retrieveSearch({ q: 'q' });
|
|
107
|
+
* ```
|
|
74
108
|
*/
|
|
75
|
-
retrieveSearch(
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
});
|
|
109
|
+
retrieveSearch(
|
|
110
|
+
query: CommunityRetrieveSearchParams,
|
|
111
|
+
options?: RequestOptions,
|
|
112
|
+
): APIPromise<Shared.PaginatedTweets> {
|
|
113
|
+
return this._client.get('/x/communities/search', { query, ...options });
|
|
81
114
|
}
|
|
82
115
|
}
|
|
83
116
|
|
|
117
|
+
/**
|
|
118
|
+
* Result of a community join or leave action.
|
|
119
|
+
*/
|
|
84
120
|
export interface CommunityActionResult {
|
|
85
121
|
communityId: string;
|
|
86
122
|
|
|
@@ -105,12 +141,88 @@ export interface CommunityRetrieveInfoResponse {
|
|
|
105
141
|
/**
|
|
106
142
|
* Community info object
|
|
107
143
|
*/
|
|
108
|
-
community:
|
|
144
|
+
community: CommunityRetrieveInfoResponse.Community;
|
|
145
|
+
}
|
|
146
|
+
|
|
147
|
+
export namespace CommunityRetrieveInfoResponse {
|
|
148
|
+
/**
|
|
149
|
+
* Community info object
|
|
150
|
+
*/
|
|
151
|
+
export interface Community {
|
|
152
|
+
/**
|
|
153
|
+
* Unique community identifier
|
|
154
|
+
*/
|
|
155
|
+
id: string;
|
|
156
|
+
|
|
157
|
+
/**
|
|
158
|
+
* Community banner image URL
|
|
159
|
+
*/
|
|
160
|
+
banner_url?: string;
|
|
161
|
+
|
|
162
|
+
/**
|
|
163
|
+
* Community creation timestamp
|
|
164
|
+
*/
|
|
165
|
+
created_at?: string;
|
|
166
|
+
|
|
167
|
+
/**
|
|
168
|
+
* About text for the community
|
|
169
|
+
*/
|
|
170
|
+
description?: string;
|
|
171
|
+
|
|
172
|
+
/**
|
|
173
|
+
* Join policy (open or restricted)
|
|
174
|
+
*/
|
|
175
|
+
join_policy?: string;
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* Total member count
|
|
179
|
+
*/
|
|
180
|
+
member_count?: number;
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Total moderator count
|
|
184
|
+
*/
|
|
185
|
+
moderator_count?: number;
|
|
186
|
+
|
|
187
|
+
/**
|
|
188
|
+
* Display name of the community
|
|
189
|
+
*/
|
|
190
|
+
name?: string;
|
|
191
|
+
|
|
192
|
+
/**
|
|
193
|
+
* Primary topic
|
|
194
|
+
*/
|
|
195
|
+
primary_topic?: Community.PrimaryTopic;
|
|
196
|
+
|
|
197
|
+
/**
|
|
198
|
+
* Community rules
|
|
199
|
+
*/
|
|
200
|
+
rules?: Array<Community.Rule>;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
export namespace Community {
|
|
204
|
+
/**
|
|
205
|
+
* Primary topic
|
|
206
|
+
*/
|
|
207
|
+
export interface PrimaryTopic {
|
|
208
|
+
id?: string;
|
|
209
|
+
|
|
210
|
+
name?: string;
|
|
211
|
+
}
|
|
212
|
+
|
|
213
|
+
export interface Rule {
|
|
214
|
+
id?: string;
|
|
215
|
+
|
|
216
|
+
description?: string;
|
|
217
|
+
|
|
218
|
+
name?: string;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
109
221
|
}
|
|
110
222
|
|
|
111
223
|
export interface CommunityCreateParams {
|
|
112
224
|
/**
|
|
113
|
-
* X account (@username or
|
|
225
|
+
* X account (@username or ID) creating the community
|
|
114
226
|
*/
|
|
115
227
|
account: string;
|
|
116
228
|
|
|
@@ -127,7 +239,7 @@ export interface CommunityCreateParams {
|
|
|
127
239
|
|
|
128
240
|
export interface CommunityDeleteParams {
|
|
129
241
|
/**
|
|
130
|
-
* X account (@username or
|
|
242
|
+
* X account (@username or ID) deleting the community
|
|
131
243
|
*/
|
|
132
244
|
account: string;
|
|
133
245
|
|
|
@@ -146,7 +258,7 @@ export interface CommunityRetrieveMembersParams {
|
|
|
146
258
|
|
|
147
259
|
export interface CommunityRetrieveModeratorsParams {
|
|
148
260
|
/**
|
|
149
|
-
* Pagination cursor
|
|
261
|
+
* Pagination cursor for community moderators
|
|
150
262
|
*/
|
|
151
263
|
cursor?: string;
|
|
152
264
|
}
|
|
@@ -158,7 +270,7 @@ export interface CommunityRetrieveSearchParams {
|
|
|
158
270
|
q: string;
|
|
159
271
|
|
|
160
272
|
/**
|
|
161
|
-
* Pagination cursor
|
|
273
|
+
* Pagination cursor for community search
|
|
162
274
|
*/
|
|
163
275
|
cursor?: string;
|
|
164
276
|
|
|
@@ -190,5 +302,9 @@ export declare namespace Communities {
|
|
|
190
302
|
type JoinDeleteAllParams as JoinDeleteAllParams,
|
|
191
303
|
};
|
|
192
304
|
|
|
193
|
-
export {
|
|
305
|
+
export {
|
|
306
|
+
Tweets as Tweets,
|
|
307
|
+
type TweetListParams as TweetListParams,
|
|
308
|
+
type TweetListByCommunityParams as TweetListByCommunityParams,
|
|
309
|
+
};
|
|
194
310
|
}
|
|
@@ -13,4 +13,4 @@ export {
|
|
|
13
13
|
type CommunityRetrieveSearchParams,
|
|
14
14
|
} from './communities';
|
|
15
15
|
export { Join, type JoinCreateParams, type JoinDeleteAllParams } from './join';
|
|
16
|
-
export { Tweets, type TweetListParams } from './tweets';
|
|
16
|
+
export { Tweets, type TweetListParams, type TweetListByCommunityParams } from './tweets';
|
|
@@ -12,6 +12,14 @@ import { path } from '../../../internal/utils/path';
|
|
|
12
12
|
export class Join extends APIResource {
|
|
13
13
|
/**
|
|
14
14
|
* Join community
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const communityActionResult =
|
|
19
|
+
* await client.x.communities.join.create('id', {
|
|
20
|
+
* account: '@elonmusk',
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
15
23
|
*/
|
|
16
24
|
create(
|
|
17
25
|
id: string,
|
|
@@ -23,6 +31,14 @@ export class Join extends APIResource {
|
|
|
23
31
|
|
|
24
32
|
/**
|
|
25
33
|
* Leave community
|
|
34
|
+
*
|
|
35
|
+
* @example
|
|
36
|
+
* ```ts
|
|
37
|
+
* const communityActionResult =
|
|
38
|
+
* await client.x.communities.join.deleteAll('id', {
|
|
39
|
+
* account: '@elonmusk',
|
|
40
|
+
* });
|
|
41
|
+
* ```
|
|
26
42
|
*/
|
|
27
43
|
deleteAll(
|
|
28
44
|
id: string,
|
|
@@ -35,14 +51,14 @@ export class Join extends APIResource {
|
|
|
35
51
|
|
|
36
52
|
export interface JoinCreateParams {
|
|
37
53
|
/**
|
|
38
|
-
* X account (@username or account ID)
|
|
54
|
+
* X account identifier (@username or account ID)
|
|
39
55
|
*/
|
|
40
56
|
account: string;
|
|
41
57
|
}
|
|
42
58
|
|
|
43
59
|
export interface JoinDeleteAllParams {
|
|
44
60
|
/**
|
|
45
|
-
* X account (@username or account ID)
|
|
61
|
+
* X account identifier (@username or account ID)
|
|
46
62
|
*/
|
|
47
63
|
account: string;
|
|
48
64
|
}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../../core/resource';
|
|
4
|
+
import * as Shared from '../../shared';
|
|
4
5
|
import { APIPromise } from '../../../core/api-promise';
|
|
5
|
-
import { buildHeaders } from '../../../internal/headers';
|
|
6
6
|
import { RequestOptions } from '../../../internal/request-options';
|
|
7
|
+
import { path } from '../../../internal/utils/path';
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* X data lookups (subscription required)
|
|
@@ -11,33 +12,62 @@ import { RequestOptions } from '../../../internal/request-options';
|
|
|
11
12
|
export class Tweets extends APIResource {
|
|
12
13
|
/**
|
|
13
14
|
* Search tweets across all communities
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const paginatedTweets =
|
|
19
|
+
* await client.x.communities.tweets.list({ q: 'q' });
|
|
20
|
+
* ```
|
|
14
21
|
*/
|
|
15
|
-
list(query: TweetListParams, options?: RequestOptions): APIPromise<
|
|
16
|
-
return this._client.get('/x/communities/tweets', {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
22
|
+
list(query: TweetListParams, options?: RequestOptions): APIPromise<Shared.PaginatedTweets> {
|
|
23
|
+
return this._client.get('/x/communities/tweets', { query, ...options });
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
/**
|
|
27
|
+
* Get community tweets
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* const paginatedTweets =
|
|
32
|
+
* await client.x.communities.tweets.listByCommunity('id');
|
|
33
|
+
* ```
|
|
34
|
+
*/
|
|
35
|
+
listByCommunity(
|
|
36
|
+
id: string,
|
|
37
|
+
query: TweetListByCommunityParams | null | undefined = {},
|
|
38
|
+
options?: RequestOptions,
|
|
39
|
+
): APIPromise<Shared.PaginatedTweets> {
|
|
40
|
+
return this._client.get(path`/x/communities/${id}/tweets`, { query, ...options });
|
|
21
41
|
}
|
|
22
42
|
}
|
|
23
43
|
|
|
24
44
|
export interface TweetListParams {
|
|
25
45
|
/**
|
|
26
|
-
* Search query
|
|
46
|
+
* Search query for cross-community tweets
|
|
27
47
|
*/
|
|
28
48
|
q: string;
|
|
29
49
|
|
|
30
50
|
/**
|
|
31
|
-
* Pagination cursor
|
|
51
|
+
* Pagination cursor for cross-community results
|
|
32
52
|
*/
|
|
33
53
|
cursor?: string;
|
|
34
54
|
|
|
35
55
|
/**
|
|
36
|
-
* Sort order (Latest or Top)
|
|
56
|
+
* Sort order for cross-community results (Latest or Top)
|
|
37
57
|
*/
|
|
38
58
|
queryType?: string;
|
|
39
59
|
}
|
|
40
60
|
|
|
61
|
+
export interface TweetListByCommunityParams {
|
|
62
|
+
/**
|
|
63
|
+
* Pagination cursor for community tweets
|
|
64
|
+
*/
|
|
65
|
+
cursor?: string;
|
|
66
|
+
}
|
|
67
|
+
|
|
41
68
|
export declare namespace Tweets {
|
|
42
|
-
export {
|
|
69
|
+
export {
|
|
70
|
+
type TweetListParams as TweetListParams,
|
|
71
|
+
type TweetListByCommunityParams as TweetListByCommunityParams,
|
|
72
|
+
};
|
|
43
73
|
}
|
package/src/resources/x/dm.ts
CHANGED
|
@@ -8,6 +8,13 @@ import { path } from '../../internal/utils/path';
|
|
|
8
8
|
export class Dm extends APIResource {
|
|
9
9
|
/**
|
|
10
10
|
* Get DM conversation history
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```ts
|
|
14
|
+
* const response = await client.x.dm.retrieveHistory(
|
|
15
|
+
* 'userId',
|
|
16
|
+
* );
|
|
17
|
+
* ```
|
|
11
18
|
*/
|
|
12
19
|
retrieveHistory(
|
|
13
20
|
userID: string,
|
|
@@ -19,6 +26,16 @@ export class Dm extends APIResource {
|
|
|
19
26
|
|
|
20
27
|
/**
|
|
21
28
|
* Send direct message
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* const response = await client.x.dm.send('userId', {
|
|
33
|
+
* account: '@elonmusk',
|
|
34
|
+
* text: 'Example text content',
|
|
35
|
+
* media_ids: ['1234567890123456789'],
|
|
36
|
+
* reply_to_message_id: '1234567890123456789',
|
|
37
|
+
* });
|
|
38
|
+
* ```
|
|
22
39
|
*/
|
|
23
40
|
send(userID: string, body: DmSendParams, options?: RequestOptions): APIPromise<DmSendResponse> {
|
|
24
41
|
return this._client.post(path`/x/dm/${userID}`, { body, ...options });
|
|
@@ -55,7 +72,7 @@ export interface DmSendResponse {
|
|
|
55
72
|
|
|
56
73
|
export interface DmRetrieveHistoryParams {
|
|
57
74
|
/**
|
|
58
|
-
* Pagination cursor
|
|
75
|
+
* Pagination cursor for DM history
|
|
59
76
|
*/
|
|
60
77
|
cursor?: string;
|
|
61
78
|
|
|
@@ -67,7 +84,7 @@ export interface DmRetrieveHistoryParams {
|
|
|
67
84
|
|
|
68
85
|
export interface DmSendParams {
|
|
69
86
|
/**
|
|
70
|
-
* X account (@username or
|
|
87
|
+
* X account (@username or ID) sending the DM
|
|
71
88
|
*/
|
|
72
89
|
account: string;
|
|
73
90
|
|
|
@@ -10,6 +10,14 @@ import { RequestOptions } from '../../internal/request-options';
|
|
|
10
10
|
export class Followers extends APIResource {
|
|
11
11
|
/**
|
|
12
12
|
* Check follow relationship
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const response = await client.x.followers.check({
|
|
17
|
+
* source: 'source',
|
|
18
|
+
* target: 'target',
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
13
21
|
*/
|
|
14
22
|
check(query: FollowerCheckParams, options?: RequestOptions): APIPromise<FollowerCheckResponse> {
|
|
15
23
|
return this._client.get('/x/followers/check', { query, ...options });
|
package/src/resources/x/index.ts
CHANGED
|
@@ -7,6 +7,7 @@ export {
|
|
|
7
7
|
type AccountCreateResponse,
|
|
8
8
|
type AccountListResponse,
|
|
9
9
|
type AccountDeleteResponse,
|
|
10
|
+
type AccountBulkRetryResponse,
|
|
10
11
|
type AccountReauthResponse,
|
|
11
12
|
type AccountCreateParams,
|
|
12
13
|
type AccountReauthParams,
|
|
@@ -90,6 +91,7 @@ export {
|
|
|
90
91
|
X,
|
|
91
92
|
type XGetArticleResponse,
|
|
92
93
|
type XGetNotificationsResponse,
|
|
94
|
+
type XGetTrendsResponse,
|
|
93
95
|
type XGetHomeTimelineParams,
|
|
94
96
|
type XGetNotificationsParams,
|
|
95
97
|
} from './x';
|
package/src/resources/x/lists.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
3
|
import { APIResource } from '../../core/resource';
|
|
4
|
+
import * as Shared from '../shared';
|
|
4
5
|
import { APIPromise } from '../../core/api-promise';
|
|
5
|
-
import { buildHeaders } from '../../internal/headers';
|
|
6
6
|
import { RequestOptions } from '../../internal/request-options';
|
|
7
7
|
import { path } from '../../internal/utils/path';
|
|
8
8
|
|
|
@@ -12,67 +12,75 @@ import { path } from '../../internal/utils/path';
|
|
|
12
12
|
export class Lists extends APIResource {
|
|
13
13
|
/**
|
|
14
14
|
* Get list followers
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const paginatedUsers =
|
|
19
|
+
* await client.x.lists.retrieveFollowers('id');
|
|
20
|
+
* ```
|
|
15
21
|
*/
|
|
16
22
|
retrieveFollowers(
|
|
17
23
|
id: string,
|
|
18
24
|
query: ListRetrieveFollowersParams | null | undefined = {},
|
|
19
25
|
options?: RequestOptions,
|
|
20
|
-
): APIPromise<
|
|
21
|
-
return this._client.get(path`/x/lists/${id}/followers`, {
|
|
22
|
-
query,
|
|
23
|
-
...options,
|
|
24
|
-
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
25
|
-
});
|
|
26
|
+
): APIPromise<Shared.PaginatedUsers> {
|
|
27
|
+
return this._client.get(path`/x/lists/${id}/followers`, { query, ...options });
|
|
26
28
|
}
|
|
27
29
|
|
|
28
30
|
/**
|
|
29
31
|
* Get list members
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* const paginatedUsers = await client.x.lists.retrieveMembers(
|
|
36
|
+
* 'id',
|
|
37
|
+
* );
|
|
38
|
+
* ```
|
|
30
39
|
*/
|
|
31
40
|
retrieveMembers(
|
|
32
41
|
id: string,
|
|
33
42
|
query: ListRetrieveMembersParams | null | undefined = {},
|
|
34
43
|
options?: RequestOptions,
|
|
35
|
-
): APIPromise<
|
|
36
|
-
return this._client.get(path`/x/lists/${id}/members`, {
|
|
37
|
-
query,
|
|
38
|
-
...options,
|
|
39
|
-
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
40
|
-
});
|
|
44
|
+
): APIPromise<Shared.PaginatedUsers> {
|
|
45
|
+
return this._client.get(path`/x/lists/${id}/members`, { query, ...options });
|
|
41
46
|
}
|
|
42
47
|
|
|
43
48
|
/**
|
|
44
49
|
* Get list tweets
|
|
50
|
+
*
|
|
51
|
+
* @example
|
|
52
|
+
* ```ts
|
|
53
|
+
* const paginatedTweets = await client.x.lists.retrieveTweets(
|
|
54
|
+
* 'id',
|
|
55
|
+
* );
|
|
56
|
+
* ```
|
|
45
57
|
*/
|
|
46
58
|
retrieveTweets(
|
|
47
59
|
id: string,
|
|
48
60
|
query: ListRetrieveTweetsParams | null | undefined = {},
|
|
49
61
|
options?: RequestOptions,
|
|
50
|
-
): APIPromise<
|
|
51
|
-
return this._client.get(path`/x/lists/${id}/tweets`, {
|
|
52
|
-
query,
|
|
53
|
-
...options,
|
|
54
|
-
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
55
|
-
});
|
|
62
|
+
): APIPromise<Shared.PaginatedTweets> {
|
|
63
|
+
return this._client.get(path`/x/lists/${id}/tweets`, { query, ...options });
|
|
56
64
|
}
|
|
57
65
|
}
|
|
58
66
|
|
|
59
67
|
export interface ListRetrieveFollowersParams {
|
|
60
68
|
/**
|
|
61
|
-
* Pagination cursor
|
|
69
|
+
* Pagination cursor for list followers
|
|
62
70
|
*/
|
|
63
71
|
cursor?: string;
|
|
64
72
|
}
|
|
65
73
|
|
|
66
74
|
export interface ListRetrieveMembersParams {
|
|
67
75
|
/**
|
|
68
|
-
* Pagination cursor
|
|
76
|
+
* Pagination cursor for list members
|
|
69
77
|
*/
|
|
70
78
|
cursor?: string;
|
|
71
79
|
}
|
|
72
80
|
|
|
73
81
|
export interface ListRetrieveTweetsParams {
|
|
74
82
|
/**
|
|
75
|
-
* Pagination cursor
|
|
83
|
+
* Pagination cursor for list tweets
|
|
76
84
|
*/
|
|
77
85
|
cursor?: string;
|
|
78
86
|
|
package/src/resources/x/media.ts
CHANGED
|
@@ -12,6 +12,13 @@ import { multipartFormRequestOptions } from '../../internal/uploads';
|
|
|
12
12
|
export class Media extends APIResource {
|
|
13
13
|
/**
|
|
14
14
|
* Download tweet media
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const response = await client.x.media.download({
|
|
19
|
+
* tweetInput: 'https://x.com/elonmusk/status/1234567890',
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
15
22
|
*/
|
|
16
23
|
download(body: MediaDownloadParams, options?: RequestOptions): APIPromise<MediaDownloadResponse> {
|
|
17
24
|
return this._client.post('/x/media/download', { body, ...options });
|
|
@@ -19,6 +26,15 @@ export class Media extends APIResource {
|
|
|
19
26
|
|
|
20
27
|
/**
|
|
21
28
|
* Upload media
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* const response = await client.x.media.upload({
|
|
33
|
+
* account: '@elonmusk',
|
|
34
|
+
* file: fs.createReadStream('path/to/file'),
|
|
35
|
+
* is_long_video: true,
|
|
36
|
+
* });
|
|
37
|
+
* ```
|
|
22
38
|
*/
|
|
23
39
|
upload(body: MediaUploadParams, options?: RequestOptions): APIPromise<MediaUploadResponse> {
|
|
24
40
|
return this._client.post('/x/media', multipartFormRequestOptions({ body, ...options }, this._client));
|
|
@@ -57,7 +73,7 @@ export interface MediaDownloadParams {
|
|
|
57
73
|
|
|
58
74
|
export interface MediaUploadParams {
|
|
59
75
|
/**
|
|
60
|
-
* X account (@username or
|
|
76
|
+
* X account (@username or ID) uploading media
|
|
61
77
|
*/
|
|
62
78
|
account: string;
|
|
63
79
|
|
|
@@ -12,6 +12,17 @@ import { multipartFormRequestOptions } from '../../internal/uploads';
|
|
|
12
12
|
export class Profile extends APIResource {
|
|
13
13
|
/**
|
|
14
14
|
* Update X profile
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const profile = await client.x.profile.update({
|
|
19
|
+
* account: '@elonmusk',
|
|
20
|
+
* description: 'description_value',
|
|
21
|
+
* location: 'location_value',
|
|
22
|
+
* name: 'Example Name',
|
|
23
|
+
* url: 'https://xquik.com/example',
|
|
24
|
+
* });
|
|
25
|
+
* ```
|
|
15
26
|
*/
|
|
16
27
|
update(body: ProfileUpdateParams, options?: RequestOptions): APIPromise<ProfileUpdateResponse> {
|
|
17
28
|
return this._client.patch('/x/profile', { body, ...options });
|
|
@@ -19,6 +30,14 @@ export class Profile extends APIResource {
|
|
|
19
30
|
|
|
20
31
|
/**
|
|
21
32
|
* Update profile avatar
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* const response = await client.x.profile.updateAvatar({
|
|
37
|
+
* account: '@elonmusk',
|
|
38
|
+
* file: fs.createReadStream('path/to/file'),
|
|
39
|
+
* });
|
|
40
|
+
* ```
|
|
22
41
|
*/
|
|
23
42
|
updateAvatar(
|
|
24
43
|
body: ProfileUpdateAvatarParams,
|
|
@@ -32,6 +51,14 @@ export class Profile extends APIResource {
|
|
|
32
51
|
|
|
33
52
|
/**
|
|
34
53
|
* Update profile banner
|
|
54
|
+
*
|
|
55
|
+
* @example
|
|
56
|
+
* ```ts
|
|
57
|
+
* const response = await client.x.profile.updateBanner({
|
|
58
|
+
* account: '@elonmusk',
|
|
59
|
+
* file: fs.createReadStream('path/to/file'),
|
|
60
|
+
* });
|
|
61
|
+
* ```
|
|
35
62
|
*/
|
|
36
63
|
updateBanner(
|
|
37
64
|
body: ProfileUpdateBannerParams,
|
|
@@ -58,7 +85,7 @@ export interface ProfileUpdateBannerResponse {
|
|
|
58
85
|
|
|
59
86
|
export interface ProfileUpdateParams {
|
|
60
87
|
/**
|
|
61
|
-
* X account (@username or
|
|
88
|
+
* X account (@username or ID) to update profile
|
|
62
89
|
*/
|
|
63
90
|
account: string;
|
|
64
91
|
|
|
@@ -82,7 +109,7 @@ export interface ProfileUpdateParams {
|
|
|
82
109
|
|
|
83
110
|
export interface ProfileUpdateAvatarParams {
|
|
84
111
|
/**
|
|
85
|
-
* X account (@username or
|
|
112
|
+
* X account (@username or ID) for avatar update
|
|
86
113
|
*/
|
|
87
114
|
account: string;
|
|
88
115
|
|
|
@@ -94,7 +121,7 @@ export interface ProfileUpdateAvatarParams {
|
|
|
94
121
|
|
|
95
122
|
export interface ProfileUpdateBannerParams {
|
|
96
123
|
/**
|
|
97
|
-
* X account (@username or
|
|
124
|
+
* X account (@username or ID) for banner update
|
|
98
125
|
*/
|
|
99
126
|
account: string;
|
|
100
127
|
|