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
package/src/resources/styles.ts
CHANGED
|
@@ -12,20 +12,42 @@ import { path } from '../internal/utils/path';
|
|
|
12
12
|
export class Styles extends APIResource {
|
|
13
13
|
/**
|
|
14
14
|
* Get cached style profile
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const styleProfile = await client.styles.retrieve('id');
|
|
19
|
+
* ```
|
|
15
20
|
*/
|
|
16
|
-
retrieve(
|
|
17
|
-
return this._client.get(path`/styles/${
|
|
21
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<StyleProfile> {
|
|
22
|
+
return this._client.get(path`/styles/${id}`, options);
|
|
18
23
|
}
|
|
19
24
|
|
|
20
25
|
/**
|
|
21
26
|
* Save style profile with custom tweets
|
|
27
|
+
*
|
|
28
|
+
* @example
|
|
29
|
+
* ```ts
|
|
30
|
+
* const styleProfile = await client.styles.update('id', {
|
|
31
|
+
* label: 'Professional Voice',
|
|
32
|
+
* tweets: [
|
|
33
|
+
* {
|
|
34
|
+
* text: 'Excited to share our latest research findings.',
|
|
35
|
+
* },
|
|
36
|
+
* ],
|
|
37
|
+
* });
|
|
38
|
+
* ```
|
|
22
39
|
*/
|
|
23
|
-
update(
|
|
24
|
-
return this._client.put(path`/styles/${
|
|
40
|
+
update(id: string, body: StyleUpdateParams, options?: RequestOptions): APIPromise<StyleProfile> {
|
|
41
|
+
return this._client.put(path`/styles/${id}`, { body, ...options });
|
|
25
42
|
}
|
|
26
43
|
|
|
27
44
|
/**
|
|
28
45
|
* List cached style profiles
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* const styles = await client.styles.list();
|
|
50
|
+
* ```
|
|
29
51
|
*/
|
|
30
52
|
list(options?: RequestOptions): APIPromise<StyleListResponse> {
|
|
31
53
|
return this._client.get('/styles', options);
|
|
@@ -33,9 +55,14 @@ export class Styles extends APIResource {
|
|
|
33
55
|
|
|
34
56
|
/**
|
|
35
57
|
* Delete a style profile
|
|
58
|
+
*
|
|
59
|
+
* @example
|
|
60
|
+
* ```ts
|
|
61
|
+
* await client.styles.delete('id');
|
|
62
|
+
* ```
|
|
36
63
|
*/
|
|
37
|
-
delete(
|
|
38
|
-
return this._client.delete(path`/styles/${
|
|
64
|
+
delete(id: string, options?: RequestOptions): APIPromise<void> {
|
|
65
|
+
return this._client.delete(path`/styles/${id}`, {
|
|
39
66
|
...options,
|
|
40
67
|
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
41
68
|
});
|
|
@@ -43,6 +70,13 @@ export class Styles extends APIResource {
|
|
|
43
70
|
|
|
44
71
|
/**
|
|
45
72
|
* Analyze writing style from recent tweets
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```ts
|
|
76
|
+
* const styleProfile = await client.styles.analyze({
|
|
77
|
+
* username: 'elonmusk',
|
|
78
|
+
* });
|
|
79
|
+
* ```
|
|
46
80
|
*/
|
|
47
81
|
analyze(body: StyleAnalyzeParams, options?: RequestOptions): APIPromise<StyleProfile> {
|
|
48
82
|
return this._client.post('/styles', { body, ...options });
|
|
@@ -50,6 +84,14 @@ export class Styles extends APIResource {
|
|
|
50
84
|
|
|
51
85
|
/**
|
|
52
86
|
* Compare two style profiles
|
|
87
|
+
*
|
|
88
|
+
* @example
|
|
89
|
+
* ```ts
|
|
90
|
+
* const response = await client.styles.compare({
|
|
91
|
+
* username1: 'username1',
|
|
92
|
+
* username2: 'username2',
|
|
93
|
+
* });
|
|
94
|
+
* ```
|
|
53
95
|
*/
|
|
54
96
|
compare(query: StyleCompareParams, options?: RequestOptions): APIPromise<StyleCompareResponse> {
|
|
55
97
|
return this._client.get('/styles/compare', { query, ...options });
|
|
@@ -57,12 +99,20 @@ export class Styles extends APIResource {
|
|
|
57
99
|
|
|
58
100
|
/**
|
|
59
101
|
* Get engagement metrics for style tweets
|
|
102
|
+
*
|
|
103
|
+
* @example
|
|
104
|
+
* ```ts
|
|
105
|
+
* const response = await client.styles.getPerformance('id');
|
|
106
|
+
* ```
|
|
60
107
|
*/
|
|
61
|
-
getPerformance(
|
|
62
|
-
return this._client.get(path`/styles/${
|
|
108
|
+
getPerformance(id: string, options?: RequestOptions): APIPromise<StyleGetPerformanceResponse> {
|
|
109
|
+
return this._client.get(path`/styles/${id}/performance`, options);
|
|
63
110
|
}
|
|
64
111
|
}
|
|
65
112
|
|
|
113
|
+
/**
|
|
114
|
+
* Full style profile with sampled tweets used for tone analysis.
|
|
115
|
+
*/
|
|
66
116
|
export interface StyleProfile {
|
|
67
117
|
fetchedAt: string;
|
|
68
118
|
|
|
@@ -87,6 +137,9 @@ export namespace StyleProfile {
|
|
|
87
137
|
}
|
|
88
138
|
}
|
|
89
139
|
|
|
140
|
+
/**
|
|
141
|
+
* Style profile summary with tweet count and ownership flag.
|
|
142
|
+
*/
|
|
90
143
|
export interface StyleProfileSummary {
|
|
91
144
|
fetchedAt: string;
|
|
92
145
|
|
|
@@ -102,8 +155,14 @@ export interface StyleListResponse {
|
|
|
102
155
|
}
|
|
103
156
|
|
|
104
157
|
export interface StyleCompareResponse {
|
|
158
|
+
/**
|
|
159
|
+
* Full style profile with sampled tweets used for tone analysis.
|
|
160
|
+
*/
|
|
105
161
|
style1: StyleProfile;
|
|
106
162
|
|
|
163
|
+
/**
|
|
164
|
+
* Full style profile with sampled tweets used for tone analysis.
|
|
165
|
+
*/
|
|
107
166
|
style2: StyleProfile;
|
|
108
167
|
}
|
|
109
168
|
|
|
@@ -11,6 +11,14 @@ import { path } from '../../internal/utils/path';
|
|
|
11
11
|
export class Tickets extends APIResource {
|
|
12
12
|
/**
|
|
13
13
|
* Create a support ticket
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const ticket = await client.support.tickets.create({
|
|
18
|
+
* body: 'I am unable to connect my X account. Please help.',
|
|
19
|
+
* subject: 'Cannot connect X account',
|
|
20
|
+
* });
|
|
21
|
+
* ```
|
|
14
22
|
*/
|
|
15
23
|
create(body: TicketCreateParams, options?: RequestOptions): APIPromise<TicketCreateResponse> {
|
|
16
24
|
return this._client.post('/support/tickets', { body, ...options });
|
|
@@ -18,6 +26,13 @@ export class Tickets extends APIResource {
|
|
|
18
26
|
|
|
19
27
|
/**
|
|
20
28
|
* Get ticket with all messages
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* const ticket = await client.support.tickets.retrieve(
|
|
33
|
+
* 'messages_value',
|
|
34
|
+
* );
|
|
35
|
+
* ```
|
|
21
36
|
*/
|
|
22
37
|
retrieve(id: string, options?: RequestOptions): APIPromise<TicketRetrieveResponse> {
|
|
23
38
|
return this._client.get(path`/support/tickets/${id}`, options);
|
|
@@ -25,6 +40,13 @@ export class Tickets extends APIResource {
|
|
|
25
40
|
|
|
26
41
|
/**
|
|
27
42
|
* Update ticket status
|
|
43
|
+
*
|
|
44
|
+
* @example
|
|
45
|
+
* ```ts
|
|
46
|
+
* const ticket = await client.support.tickets.update('id', {
|
|
47
|
+
* status: 'resolved',
|
|
48
|
+
* });
|
|
49
|
+
* ```
|
|
28
50
|
*/
|
|
29
51
|
update(id: string, body: TicketUpdateParams, options?: RequestOptions): APIPromise<TicketUpdateResponse> {
|
|
30
52
|
return this._client.patch(path`/support/tickets/${id}`, { body, ...options });
|
|
@@ -32,6 +54,11 @@ export class Tickets extends APIResource {
|
|
|
32
54
|
|
|
33
55
|
/**
|
|
34
56
|
* List user's support tickets
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* const tickets = await client.support.tickets.list();
|
|
61
|
+
* ```
|
|
35
62
|
*/
|
|
36
63
|
list(options?: RequestOptions): APIPromise<TicketListResponse> {
|
|
37
64
|
return this._client.get('/support/tickets', options);
|
|
@@ -39,6 +66,13 @@ export class Tickets extends APIResource {
|
|
|
39
66
|
|
|
40
67
|
/**
|
|
41
68
|
* Reply to a support ticket
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```ts
|
|
72
|
+
* const response = await client.support.tickets.reply('id', {
|
|
73
|
+
* body: 'Thank you for the update.',
|
|
74
|
+
* });
|
|
75
|
+
* ```
|
|
42
76
|
*/
|
|
43
77
|
reply(id: string, body: TicketReplyParams, options?: RequestOptions): APIPromise<TicketReplyResponse> {
|
|
44
78
|
return this._client.post(path`/support/tickets/${id}/messages`, { body, ...options });
|
package/src/resources/trends.ts
CHANGED
|
@@ -9,7 +9,7 @@ import { RequestOptions } from '../internal/request-options';
|
|
|
9
9
|
*/
|
|
10
10
|
export class Trends extends APIResource {
|
|
11
11
|
/**
|
|
12
|
-
* Get trending topics
|
|
12
|
+
* Get regional trending topics
|
|
13
13
|
*/
|
|
14
14
|
list(
|
|
15
15
|
query: TrendListParams | null | undefined = {},
|
|
@@ -40,6 +40,9 @@ export namespace TrendListResponse {
|
|
|
40
40
|
}
|
|
41
41
|
|
|
42
42
|
export interface TrendListParams {
|
|
43
|
+
/**
|
|
44
|
+
* Number of trending topics to return (1-50, default 30)
|
|
45
|
+
*/
|
|
43
46
|
count?: number;
|
|
44
47
|
|
|
45
48
|
/**
|
|
@@ -12,6 +12,14 @@ import { path } from '../internal/utils/path';
|
|
|
12
12
|
export class Webhooks extends APIResource {
|
|
13
13
|
/**
|
|
14
14
|
* Create webhook
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const webhook = await client.webhooks.create({
|
|
19
|
+
* eventTypes: ['tweet.new', 'follower.gained'],
|
|
20
|
+
* url: 'https://example.com/webhook',
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
15
23
|
*/
|
|
16
24
|
create(body: WebhookCreateParams, options?: RequestOptions): APIPromise<WebhookCreateResponse> {
|
|
17
25
|
return this._client.post('/webhooks', { body, ...options });
|
|
@@ -19,6 +27,14 @@ export class Webhooks extends APIResource {
|
|
|
19
27
|
|
|
20
28
|
/**
|
|
21
29
|
* Update webhook
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* const webhook = await client.webhooks.update('id', {
|
|
34
|
+
* isActive: true,
|
|
35
|
+
* url: 'https://example.com/webhook',
|
|
36
|
+
* });
|
|
37
|
+
* ```
|
|
22
38
|
*/
|
|
23
39
|
update(id: string, body: WebhookUpdateParams, options?: RequestOptions): APIPromise<Webhook> {
|
|
24
40
|
return this._client.patch(path`/webhooks/${id}`, { body, ...options });
|
|
@@ -26,6 +42,11 @@ export class Webhooks extends APIResource {
|
|
|
26
42
|
|
|
27
43
|
/**
|
|
28
44
|
* List webhooks
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* const webhooks = await client.webhooks.list();
|
|
49
|
+
* ```
|
|
29
50
|
*/
|
|
30
51
|
list(options?: RequestOptions): APIPromise<WebhookListResponse> {
|
|
31
52
|
return this._client.get('/webhooks', options);
|
|
@@ -33,6 +54,11 @@ export class Webhooks extends APIResource {
|
|
|
33
54
|
|
|
34
55
|
/**
|
|
35
56
|
* Deactivate webhook
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* const response = await client.webhooks.deactivate('id');
|
|
61
|
+
* ```
|
|
36
62
|
*/
|
|
37
63
|
deactivate(id: string, options?: RequestOptions): APIPromise<WebhookDeactivateResponse> {
|
|
38
64
|
return this._client.delete(path`/webhooks/${id}`, options);
|
|
@@ -40,6 +66,11 @@ export class Webhooks extends APIResource {
|
|
|
40
66
|
|
|
41
67
|
/**
|
|
42
68
|
* List webhook deliveries
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```ts
|
|
72
|
+
* const response = await client.webhooks.listDeliveries('id');
|
|
73
|
+
* ```
|
|
43
74
|
*/
|
|
44
75
|
listDeliveries(id: string, options?: RequestOptions): APIPromise<WebhookListDeliveriesResponse> {
|
|
45
76
|
return this._client.get(path`/webhooks/${id}/deliveries`, options);
|
|
@@ -47,12 +78,20 @@ export class Webhooks extends APIResource {
|
|
|
47
78
|
|
|
48
79
|
/**
|
|
49
80
|
* Test webhook endpoint
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```ts
|
|
84
|
+
* const response = await client.webhooks.test('id');
|
|
85
|
+
* ```
|
|
50
86
|
*/
|
|
51
87
|
test(id: string, options?: RequestOptions): APIPromise<WebhookTestResponse> {
|
|
52
88
|
return this._client.post(path`/webhooks/${id}/test`, options);
|
|
53
89
|
}
|
|
54
90
|
}
|
|
55
91
|
|
|
92
|
+
/**
|
|
93
|
+
* Webhook delivery attempt record with status and retry count.
|
|
94
|
+
*/
|
|
56
95
|
export interface Delivery {
|
|
57
96
|
id: string;
|
|
58
97
|
|
|
@@ -71,11 +110,17 @@ export interface Delivery {
|
|
|
71
110
|
lastStatusCode?: number;
|
|
72
111
|
}
|
|
73
112
|
|
|
113
|
+
/**
|
|
114
|
+
* Webhook endpoint registered to receive event deliveries.
|
|
115
|
+
*/
|
|
74
116
|
export interface Webhook {
|
|
75
117
|
id: string;
|
|
76
118
|
|
|
77
119
|
createdAt: string;
|
|
78
120
|
|
|
121
|
+
/**
|
|
122
|
+
* Array of event types to subscribe to.
|
|
123
|
+
*/
|
|
79
124
|
eventTypes: Array<Shared.EventType>;
|
|
80
125
|
|
|
81
126
|
isActive: boolean;
|
|
@@ -88,6 +133,9 @@ export interface WebhookCreateResponse {
|
|
|
88
133
|
|
|
89
134
|
createdAt: string;
|
|
90
135
|
|
|
136
|
+
/**
|
|
137
|
+
* Array of event types to subscribe to.
|
|
138
|
+
*/
|
|
91
139
|
eventTypes: Array<Shared.EventType>;
|
|
92
140
|
|
|
93
141
|
secret: string;
|
|
@@ -116,6 +164,9 @@ export interface WebhookTestResponse {
|
|
|
116
164
|
}
|
|
117
165
|
|
|
118
166
|
export interface WebhookCreateParams {
|
|
167
|
+
/**
|
|
168
|
+
* Array of event types to subscribe to.
|
|
169
|
+
*/
|
|
119
170
|
eventTypes: Array<Shared.EventType>;
|
|
120
171
|
|
|
121
172
|
/**
|
|
@@ -125,6 +176,9 @@ export interface WebhookCreateParams {
|
|
|
125
176
|
}
|
|
126
177
|
|
|
127
178
|
export interface WebhookUpdateParams {
|
|
179
|
+
/**
|
|
180
|
+
* Array of event types to subscribe to.
|
|
181
|
+
*/
|
|
128
182
|
eventTypes?: Array<Shared.EventType>;
|
|
129
183
|
|
|
130
184
|
isActive?: boolean;
|
|
@@ -11,40 +11,94 @@ import { path } from '../../internal/utils/path';
|
|
|
11
11
|
export class Accounts extends APIResource {
|
|
12
12
|
/**
|
|
13
13
|
* Connect X account
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const account = await client.x.accounts.create({
|
|
18
|
+
* email: 'user@example.com',
|
|
19
|
+
* password: 's3cur3Pa$$w0rd',
|
|
20
|
+
* username: 'elonmusk',
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
14
23
|
*/
|
|
15
24
|
create(body: AccountCreateParams, options?: RequestOptions): APIPromise<AccountCreateResponse> {
|
|
16
|
-
return this._client.post('/x/accounts', { body, ...options, __security: {} });
|
|
25
|
+
return this._client.post('/x/accounts', { body, ...options, __security: { apiKeyAuth: true } });
|
|
17
26
|
}
|
|
18
27
|
|
|
19
28
|
/**
|
|
20
29
|
* Get X account details
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* const xAccountDetail = await client.x.accounts.retrieve(
|
|
34
|
+
* 'id',
|
|
35
|
+
* );
|
|
36
|
+
* ```
|
|
21
37
|
*/
|
|
22
38
|
retrieve(id: string, options?: RequestOptions): APIPromise<XAccountDetail> {
|
|
23
|
-
return this._client.get(path`/x/accounts/${id}`, { ...options, __security: {} });
|
|
39
|
+
return this._client.get(path`/x/accounts/${id}`, { ...options, __security: { apiKeyAuth: true } });
|
|
24
40
|
}
|
|
25
41
|
|
|
26
42
|
/**
|
|
27
43
|
* List connected X accounts
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* const accounts = await client.x.accounts.list();
|
|
48
|
+
* ```
|
|
28
49
|
*/
|
|
29
50
|
list(options?: RequestOptions): APIPromise<AccountListResponse> {
|
|
30
|
-
return this._client.get('/x/accounts', { ...options, __security: {} });
|
|
51
|
+
return this._client.get('/x/accounts', { ...options, __security: { apiKeyAuth: true } });
|
|
31
52
|
}
|
|
32
53
|
|
|
33
54
|
/**
|
|
34
55
|
* Disconnect X account
|
|
56
|
+
*
|
|
57
|
+
* @example
|
|
58
|
+
* ```ts
|
|
59
|
+
* const account = await client.x.accounts.delete('id');
|
|
60
|
+
* ```
|
|
35
61
|
*/
|
|
36
62
|
delete(id: string, options?: RequestOptions): APIPromise<AccountDeleteResponse> {
|
|
37
|
-
return this._client.delete(path`/x/accounts/${id}`, { ...options, __security: {} });
|
|
63
|
+
return this._client.delete(path`/x/accounts/${id}`, { ...options, __security: { apiKeyAuth: true } });
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Clears loginFailedAt and loginFailureReason for all accounts with transient or
|
|
68
|
+
* automated failure reasons, making them eligible for retry on next use.
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```ts
|
|
72
|
+
* const response = await client.x.accounts.bulkRetry();
|
|
73
|
+
* ```
|
|
74
|
+
*/
|
|
75
|
+
bulkRetry(options?: RequestOptions): APIPromise<AccountBulkRetryResponse> {
|
|
76
|
+
return this._client.post('/x/accounts/bulk-retry', { ...options, __security: { apiKeyAuth: true } });
|
|
38
77
|
}
|
|
39
78
|
|
|
40
79
|
/**
|
|
41
80
|
* Re-authenticate X account
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```ts
|
|
84
|
+
* const response = await client.x.accounts.reauth('id', {
|
|
85
|
+
* password: 'password_value',
|
|
86
|
+
* totp_secret: 'totp_secret_value',
|
|
87
|
+
* });
|
|
88
|
+
* ```
|
|
42
89
|
*/
|
|
43
90
|
reauth(id: string, body: AccountReauthParams, options?: RequestOptions): APIPromise<AccountReauthResponse> {
|
|
44
|
-
return this._client.post(path`/x/accounts/${id}/reauth`, {
|
|
91
|
+
return this._client.post(path`/x/accounts/${id}/reauth`, {
|
|
92
|
+
body,
|
|
93
|
+
...options,
|
|
94
|
+
__security: { apiKeyAuth: true },
|
|
95
|
+
});
|
|
45
96
|
}
|
|
46
97
|
}
|
|
47
98
|
|
|
99
|
+
/**
|
|
100
|
+
* Linked X account summary with username and connection status.
|
|
101
|
+
*/
|
|
48
102
|
export interface XAccount {
|
|
49
103
|
id: string;
|
|
50
104
|
|
|
@@ -57,6 +111,9 @@ export interface XAccount {
|
|
|
57
111
|
xUsername: string;
|
|
58
112
|
}
|
|
59
113
|
|
|
114
|
+
/**
|
|
115
|
+
* Full X account details including proxy, cookies, and update timestamp.
|
|
116
|
+
*/
|
|
60
117
|
export interface XAccountDetail {
|
|
61
118
|
id: string;
|
|
62
119
|
|
|
@@ -93,6 +150,13 @@ export interface AccountDeleteResponse {
|
|
|
93
150
|
success: true;
|
|
94
151
|
}
|
|
95
152
|
|
|
153
|
+
export interface AccountBulkRetryResponse {
|
|
154
|
+
/**
|
|
155
|
+
* Number of accounts cleared
|
|
156
|
+
*/
|
|
157
|
+
cleared: number;
|
|
158
|
+
}
|
|
159
|
+
|
|
96
160
|
export interface AccountReauthResponse {
|
|
97
161
|
id: string;
|
|
98
162
|
|
|
@@ -130,12 +194,12 @@ export interface AccountCreateParams {
|
|
|
130
194
|
|
|
131
195
|
export interface AccountReauthParams {
|
|
132
196
|
/**
|
|
133
|
-
*
|
|
197
|
+
* Updated account password
|
|
134
198
|
*/
|
|
135
199
|
password: string;
|
|
136
200
|
|
|
137
201
|
/**
|
|
138
|
-
* TOTP secret for 2FA
|
|
202
|
+
* TOTP secret for 2FA re-authentication
|
|
139
203
|
*/
|
|
140
204
|
totp_secret?: string;
|
|
141
205
|
}
|
|
@@ -147,6 +211,7 @@ export declare namespace Accounts {
|
|
|
147
211
|
type AccountCreateResponse as AccountCreateResponse,
|
|
148
212
|
type AccountListResponse as AccountListResponse,
|
|
149
213
|
type AccountDeleteResponse as AccountDeleteResponse,
|
|
214
|
+
type AccountBulkRetryResponse as AccountBulkRetryResponse,
|
|
150
215
|
type AccountReauthResponse as AccountReauthResponse,
|
|
151
216
|
type AccountCreateParams as AccountCreateParams,
|
|
152
217
|
type AccountReauthParams as AccountReauthParams,
|
|
@@ -11,6 +11,11 @@ import { RequestOptions } from '../../internal/request-options';
|
|
|
11
11
|
export class Bookmarks extends APIResource {
|
|
12
12
|
/**
|
|
13
13
|
* Get bookmarked tweets
|
|
14
|
+
*
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const paginatedTweets = await client.x.bookmarks.list();
|
|
18
|
+
* ```
|
|
14
19
|
*/
|
|
15
20
|
list(
|
|
16
21
|
query: BookmarkListParams | null | undefined = {},
|
|
@@ -21,6 +26,11 @@ export class Bookmarks extends APIResource {
|
|
|
21
26
|
|
|
22
27
|
/**
|
|
23
28
|
* Get bookmark folders
|
|
29
|
+
*
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* const response = await client.x.bookmarks.retrieveFolders();
|
|
33
|
+
* ```
|
|
24
34
|
*/
|
|
25
35
|
retrieveFolders(options?: RequestOptions): APIPromise<BookmarkRetrieveFoldersResponse> {
|
|
26
36
|
return this._client.get('/x/bookmarks/folders', options);
|
|
@@ -45,7 +55,7 @@ export namespace BookmarkRetrieveFoldersResponse {
|
|
|
45
55
|
|
|
46
56
|
export interface BookmarkListParams {
|
|
47
57
|
/**
|
|
48
|
-
* Pagination cursor
|
|
58
|
+
* Pagination cursor for bookmarks
|
|
49
59
|
*/
|
|
50
60
|
cursor?: string;
|
|
51
61
|
|