x-twitter-scraper 0.1.0 → 0.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +22 -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/events.ts
CHANGED
|
@@ -28,6 +28,9 @@ export class Events extends APIResource {
|
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
/**
|
|
32
|
+
* Monitor event summary with type, username, and occurrence time.
|
|
33
|
+
*/
|
|
31
34
|
export interface Event {
|
|
32
35
|
id: string;
|
|
33
36
|
|
|
@@ -37,20 +40,32 @@ export interface Event {
|
|
|
37
40
|
|
|
38
41
|
occurredAt: string;
|
|
39
42
|
|
|
43
|
+
/**
|
|
44
|
+
* Type of monitor event fired when account activity occurs.
|
|
45
|
+
*/
|
|
40
46
|
type: Shared.EventType;
|
|
41
47
|
|
|
42
48
|
username: string;
|
|
43
49
|
}
|
|
44
50
|
|
|
51
|
+
/**
|
|
52
|
+
* Full monitor event including payload data and optional X event ID.
|
|
53
|
+
*/
|
|
45
54
|
export interface EventDetail {
|
|
46
55
|
id: string;
|
|
47
56
|
|
|
57
|
+
/**
|
|
58
|
+
* Event payload — shape varies by event type (JSON)
|
|
59
|
+
*/
|
|
48
60
|
data: { [key: string]: unknown };
|
|
49
61
|
|
|
50
62
|
monitorId: string;
|
|
51
63
|
|
|
52
64
|
occurredAt: string;
|
|
53
65
|
|
|
66
|
+
/**
|
|
67
|
+
* Type of monitor event fired when account activity occurs.
|
|
68
|
+
*/
|
|
54
69
|
type: Shared.EventType;
|
|
55
70
|
|
|
56
71
|
username: string;
|
|
@@ -68,14 +83,23 @@ export interface EventListResponse {
|
|
|
68
83
|
|
|
69
84
|
export interface EventListParams {
|
|
70
85
|
/**
|
|
71
|
-
* Cursor for pagination
|
|
86
|
+
* Cursor for keyset pagination
|
|
72
87
|
*/
|
|
73
88
|
after?: string;
|
|
74
89
|
|
|
90
|
+
/**
|
|
91
|
+
* Filter events by type
|
|
92
|
+
*/
|
|
75
93
|
eventType?: Shared.EventType;
|
|
76
94
|
|
|
95
|
+
/**
|
|
96
|
+
* Maximum number of items to return (1-100, default 50)
|
|
97
|
+
*/
|
|
77
98
|
limit?: number;
|
|
78
99
|
|
|
100
|
+
/**
|
|
101
|
+
* Filter events by monitor ID
|
|
102
|
+
*/
|
|
79
103
|
monitorId?: string;
|
|
80
104
|
}
|
|
81
105
|
|
|
@@ -12,6 +12,11 @@ import { path } from '../internal/utils/path';
|
|
|
12
12
|
export class Extractions extends APIResource {
|
|
13
13
|
/**
|
|
14
14
|
* Get extraction results
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const extraction = await client.extractions.retrieve('id');
|
|
19
|
+
* ```
|
|
15
20
|
*/
|
|
16
21
|
retrieve(
|
|
17
22
|
id: string,
|
|
@@ -23,6 +28,11 @@ export class Extractions extends APIResource {
|
|
|
23
28
|
|
|
24
29
|
/**
|
|
25
30
|
* List extraction jobs
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* const extractions = await client.extractions.list();
|
|
35
|
+
* ```
|
|
26
36
|
*/
|
|
27
37
|
list(
|
|
28
38
|
query: ExtractionListParams | null | undefined = {},
|
|
@@ -33,6 +43,14 @@ export class Extractions extends APIResource {
|
|
|
33
43
|
|
|
34
44
|
/**
|
|
35
45
|
* Estimate extraction cost
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* const response = await client.extractions.estimateCost({
|
|
50
|
+
* toolType: 'follower_explorer',
|
|
51
|
+
* targetUsername: 'elonmusk',
|
|
52
|
+
* });
|
|
53
|
+
* ```
|
|
36
54
|
*/
|
|
37
55
|
estimateCost(
|
|
38
56
|
body: ExtractionEstimateCostParams,
|
|
@@ -43,6 +61,16 @@ export class Extractions extends APIResource {
|
|
|
43
61
|
|
|
44
62
|
/**
|
|
45
63
|
* Export extraction results
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```ts
|
|
67
|
+
* const response = await client.extractions.exportResults(
|
|
68
|
+
* 'id',
|
|
69
|
+
* );
|
|
70
|
+
*
|
|
71
|
+
* const content = await response.blob();
|
|
72
|
+
* console.log(content);
|
|
73
|
+
* ```
|
|
46
74
|
*/
|
|
47
75
|
exportResults(
|
|
48
76
|
id: string,
|
|
@@ -59,12 +87,23 @@ export class Extractions extends APIResource {
|
|
|
59
87
|
|
|
60
88
|
/**
|
|
61
89
|
* Run extraction
|
|
90
|
+
*
|
|
91
|
+
* @example
|
|
92
|
+
* ```ts
|
|
93
|
+
* const response = await client.extractions.run({
|
|
94
|
+
* toolType: 'follower_explorer',
|
|
95
|
+
* targetUsername: 'elonmusk',
|
|
96
|
+
* });
|
|
97
|
+
* ```
|
|
62
98
|
*/
|
|
63
99
|
run(body: ExtractionRunParams, options?: RequestOptions): APIPromise<ExtractionRunResponse> {
|
|
64
100
|
return this._client.post('/extractions', { body, ...options });
|
|
65
101
|
}
|
|
66
102
|
}
|
|
67
103
|
|
|
104
|
+
/**
|
|
105
|
+
* Extraction job tracking status, tool type, and result count.
|
|
106
|
+
*/
|
|
68
107
|
export interface ExtractionJob {
|
|
69
108
|
id: string;
|
|
70
109
|
|
|
@@ -72,6 +111,9 @@ export interface ExtractionJob {
|
|
|
72
111
|
|
|
73
112
|
status: 'running' | 'completed' | 'failed';
|
|
74
113
|
|
|
114
|
+
/**
|
|
115
|
+
* Identifier for the extraction tool used to run a job.
|
|
116
|
+
*/
|
|
75
117
|
toolType:
|
|
76
118
|
| 'article_extractor'
|
|
77
119
|
| 'community_extractor'
|
|
@@ -102,6 +144,9 @@ export interface ExtractionJob {
|
|
|
102
144
|
export interface ExtractionRetrieveResponse {
|
|
103
145
|
hasMore: boolean;
|
|
104
146
|
|
|
147
|
+
/**
|
|
148
|
+
* Extraction job metadata — shape varies by tool type (JSON)
|
|
149
|
+
*/
|
|
105
150
|
job: { [key: string]: unknown };
|
|
106
151
|
|
|
107
152
|
results: Array<{ [key: string]: unknown }>;
|
|
@@ -134,6 +179,9 @@ export interface ExtractionRunResponse {
|
|
|
134
179
|
|
|
135
180
|
status: 'running';
|
|
136
181
|
|
|
182
|
+
/**
|
|
183
|
+
* Identifier for the extraction tool used to run a job.
|
|
184
|
+
*/
|
|
137
185
|
toolType:
|
|
138
186
|
| 'article_extractor'
|
|
139
187
|
| 'community_extractor'
|
|
@@ -159,23 +207,35 @@ export interface ExtractionRunResponse {
|
|
|
159
207
|
|
|
160
208
|
export interface ExtractionRetrieveParams {
|
|
161
209
|
/**
|
|
162
|
-
* Cursor for pagination
|
|
210
|
+
* Cursor for keyset pagination
|
|
163
211
|
*/
|
|
164
212
|
after?: string;
|
|
165
213
|
|
|
214
|
+
/**
|
|
215
|
+
* Maximum number of results to return (1-1000, default 100)
|
|
216
|
+
*/
|
|
166
217
|
limit?: number;
|
|
167
218
|
}
|
|
168
219
|
|
|
169
220
|
export interface ExtractionListParams {
|
|
170
221
|
/**
|
|
171
|
-
* Cursor for pagination
|
|
222
|
+
* Cursor for keyset pagination
|
|
172
223
|
*/
|
|
173
224
|
after?: string;
|
|
174
225
|
|
|
226
|
+
/**
|
|
227
|
+
* Maximum number of items to return (1-100, default 50)
|
|
228
|
+
*/
|
|
175
229
|
limit?: number;
|
|
176
230
|
|
|
231
|
+
/**
|
|
232
|
+
* Filter by job status
|
|
233
|
+
*/
|
|
177
234
|
status?: 'running' | 'completed' | 'failed';
|
|
178
235
|
|
|
236
|
+
/**
|
|
237
|
+
* Filter by extraction tool type
|
|
238
|
+
*/
|
|
179
239
|
toolType?:
|
|
180
240
|
| 'article_extractor'
|
|
181
241
|
| 'community_extractor'
|
|
@@ -200,6 +260,9 @@ export interface ExtractionListParams {
|
|
|
200
260
|
}
|
|
201
261
|
|
|
202
262
|
export interface ExtractionEstimateCostParams {
|
|
263
|
+
/**
|
|
264
|
+
* Identifier for the extraction tool used to run a job.
|
|
265
|
+
*/
|
|
203
266
|
toolType:
|
|
204
267
|
| 'article_extractor'
|
|
205
268
|
| 'community_extractor'
|
|
@@ -223,17 +286,17 @@ export interface ExtractionEstimateCostParams {
|
|
|
223
286
|
| 'verified_follower_explorer';
|
|
224
287
|
|
|
225
288
|
/**
|
|
226
|
-
* Raw advanced
|
|
289
|
+
* Raw advanced query string appended to the estimate (tweet_search_extractor)
|
|
227
290
|
*/
|
|
228
291
|
advancedQuery?: string;
|
|
229
292
|
|
|
230
293
|
/**
|
|
231
|
-
* Exact phrase
|
|
294
|
+
* Exact phrase filter for search estimation
|
|
232
295
|
*/
|
|
233
296
|
exactPhrase?: string;
|
|
234
297
|
|
|
235
298
|
/**
|
|
236
|
-
* Words
|
|
299
|
+
* Words excluded from estimated search results
|
|
237
300
|
*/
|
|
238
301
|
excludeWords?: string;
|
|
239
302
|
|
|
@@ -251,10 +314,16 @@ export interface ExtractionEstimateCostParams {
|
|
|
251
314
|
}
|
|
252
315
|
|
|
253
316
|
export interface ExtractionExportResultsParams {
|
|
317
|
+
/**
|
|
318
|
+
* Export file format
|
|
319
|
+
*/
|
|
254
320
|
format?: 'csv' | 'json' | 'md' | 'md-document' | 'pdf' | 'txt' | 'xlsx';
|
|
255
321
|
}
|
|
256
322
|
|
|
257
323
|
export interface ExtractionRunParams {
|
|
324
|
+
/**
|
|
325
|
+
* Identifier for the extraction tool used to run a job.
|
|
326
|
+
*/
|
|
258
327
|
toolType:
|
|
259
328
|
| 'article_extractor'
|
|
260
329
|
| 'community_extractor'
|
package/src/resources/index.ts
CHANGED
|
@@ -12,6 +12,16 @@ import { path } from '../internal/utils/path';
|
|
|
12
12
|
export class Integrations extends APIResource {
|
|
13
13
|
/**
|
|
14
14
|
* Create integration
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const integration = await client.integrations.create({
|
|
19
|
+
* config: { chatId: '-1001234567890' },
|
|
20
|
+
* eventTypes: ['tweet.new', 'follower.gained'],
|
|
21
|
+
* name: 'My Telegram Bot',
|
|
22
|
+
* type: 'telegram',
|
|
23
|
+
* });
|
|
24
|
+
* ```
|
|
15
25
|
*/
|
|
16
26
|
create(body: IntegrationCreateParams, options?: RequestOptions): APIPromise<Integration> {
|
|
17
27
|
return this._client.post('/integrations', { body, ...options });
|
|
@@ -19,6 +29,13 @@ export class Integrations extends APIResource {
|
|
|
19
29
|
|
|
20
30
|
/**
|
|
21
31
|
* Get integration details
|
|
32
|
+
*
|
|
33
|
+
* @example
|
|
34
|
+
* ```ts
|
|
35
|
+
* const integration = await client.integrations.retrieve(
|
|
36
|
+
* 'id',
|
|
37
|
+
* );
|
|
38
|
+
* ```
|
|
22
39
|
*/
|
|
23
40
|
retrieve(id: string, options?: RequestOptions): APIPromise<Integration> {
|
|
24
41
|
return this._client.get(path`/integrations/${id}`, options);
|
|
@@ -26,6 +43,14 @@ export class Integrations extends APIResource {
|
|
|
26
43
|
|
|
27
44
|
/**
|
|
28
45
|
* Update integration
|
|
46
|
+
*
|
|
47
|
+
* @example
|
|
48
|
+
* ```ts
|
|
49
|
+
* const integration = await client.integrations.update('id', {
|
|
50
|
+
* isActive: true,
|
|
51
|
+
* name: 'My Telegram Bot',
|
|
52
|
+
* });
|
|
53
|
+
* ```
|
|
29
54
|
*/
|
|
30
55
|
update(id: string, body: IntegrationUpdateParams, options?: RequestOptions): APIPromise<Integration> {
|
|
31
56
|
return this._client.patch(path`/integrations/${id}`, { body, ...options });
|
|
@@ -33,6 +58,11 @@ export class Integrations extends APIResource {
|
|
|
33
58
|
|
|
34
59
|
/**
|
|
35
60
|
* List integrations
|
|
61
|
+
*
|
|
62
|
+
* @example
|
|
63
|
+
* ```ts
|
|
64
|
+
* const integrations = await client.integrations.list();
|
|
65
|
+
* ```
|
|
36
66
|
*/
|
|
37
67
|
list(options?: RequestOptions): APIPromise<IntegrationListResponse> {
|
|
38
68
|
return this._client.get('/integrations', options);
|
|
@@ -40,6 +70,11 @@ export class Integrations extends APIResource {
|
|
|
40
70
|
|
|
41
71
|
/**
|
|
42
72
|
* Delete integration
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```ts
|
|
76
|
+
* const integration = await client.integrations.delete('id');
|
|
77
|
+
* ```
|
|
43
78
|
*/
|
|
44
79
|
delete(id: string, options?: RequestOptions): APIPromise<IntegrationDeleteResponse> {
|
|
45
80
|
return this._client.delete(path`/integrations/${id}`, options);
|
|
@@ -47,6 +82,13 @@ export class Integrations extends APIResource {
|
|
|
47
82
|
|
|
48
83
|
/**
|
|
49
84
|
* List integration delivery history
|
|
85
|
+
*
|
|
86
|
+
* @example
|
|
87
|
+
* ```ts
|
|
88
|
+
* const response = await client.integrations.listDeliveries(
|
|
89
|
+
* 'id',
|
|
90
|
+
* );
|
|
91
|
+
* ```
|
|
50
92
|
*/
|
|
51
93
|
listDeliveries(
|
|
52
94
|
id: string,
|
|
@@ -58,19 +100,33 @@ export class Integrations extends APIResource {
|
|
|
58
100
|
|
|
59
101
|
/**
|
|
60
102
|
* Send test delivery
|
|
103
|
+
*
|
|
104
|
+
* @example
|
|
105
|
+
* ```ts
|
|
106
|
+
* const response = await client.integrations.sendTest('id');
|
|
107
|
+
* ```
|
|
61
108
|
*/
|
|
62
109
|
sendTest(id: string, options?: RequestOptions): APIPromise<IntegrationSendTestResponse> {
|
|
63
110
|
return this._client.post(path`/integrations/${id}/test`, options);
|
|
64
111
|
}
|
|
65
112
|
}
|
|
66
113
|
|
|
114
|
+
/**
|
|
115
|
+
* Third-party integration (e.g. Telegram) subscribed to monitor events.
|
|
116
|
+
*/
|
|
67
117
|
export interface Integration {
|
|
68
118
|
id: string;
|
|
69
119
|
|
|
120
|
+
/**
|
|
121
|
+
* Integration config — shape varies by type (JSON)
|
|
122
|
+
*/
|
|
70
123
|
config: { [key: string]: unknown };
|
|
71
124
|
|
|
72
125
|
createdAt: string;
|
|
73
126
|
|
|
127
|
+
/**
|
|
128
|
+
* Array of event types to subscribe to.
|
|
129
|
+
*/
|
|
74
130
|
eventTypes: Array<Shared.EventType>;
|
|
75
131
|
|
|
76
132
|
isActive: boolean;
|
|
@@ -79,6 +135,9 @@ export interface Integration {
|
|
|
79
135
|
|
|
80
136
|
type: 'telegram';
|
|
81
137
|
|
|
138
|
+
/**
|
|
139
|
+
* Event filter rules (JSON)
|
|
140
|
+
*/
|
|
82
141
|
filters?: { [key: string]: unknown };
|
|
83
142
|
|
|
84
143
|
messageTemplate?: string;
|
|
@@ -88,6 +147,9 @@ export interface Integration {
|
|
|
88
147
|
silentPush?: boolean;
|
|
89
148
|
}
|
|
90
149
|
|
|
150
|
+
/**
|
|
151
|
+
* Integration delivery attempt record with status and retry count.
|
|
152
|
+
*/
|
|
91
153
|
export interface IntegrationDelivery {
|
|
92
154
|
id: string;
|
|
93
155
|
|
|
@@ -132,6 +194,9 @@ export interface IntegrationCreateParams {
|
|
|
132
194
|
*/
|
|
133
195
|
config: IntegrationCreateParams.Config;
|
|
134
196
|
|
|
197
|
+
/**
|
|
198
|
+
* Array of event types to subscribe to.
|
|
199
|
+
*/
|
|
135
200
|
eventTypes: Array<Shared.EventType>;
|
|
136
201
|
|
|
137
202
|
name: string;
|
|
@@ -149,12 +214,21 @@ export namespace IntegrationCreateParams {
|
|
|
149
214
|
}
|
|
150
215
|
|
|
151
216
|
export interface IntegrationUpdateParams {
|
|
217
|
+
/**
|
|
218
|
+
* Array of event types to subscribe to.
|
|
219
|
+
*/
|
|
152
220
|
eventTypes?: Array<Shared.EventType>;
|
|
153
221
|
|
|
222
|
+
/**
|
|
223
|
+
* Event filter rules (JSON)
|
|
224
|
+
*/
|
|
154
225
|
filters?: { [key: string]: unknown };
|
|
155
226
|
|
|
156
227
|
isActive?: boolean;
|
|
157
228
|
|
|
229
|
+
/**
|
|
230
|
+
* Custom message template (JSON)
|
|
231
|
+
*/
|
|
158
232
|
messageTemplate?: { [key: string]: unknown };
|
|
159
233
|
|
|
160
234
|
name?: string;
|
|
@@ -165,6 +239,9 @@ export interface IntegrationUpdateParams {
|
|
|
165
239
|
}
|
|
166
240
|
|
|
167
241
|
export interface IntegrationListDeliveriesParams {
|
|
242
|
+
/**
|
|
243
|
+
* Maximum number of items to return (1-100, default 50)
|
|
244
|
+
*/
|
|
168
245
|
limit?: number;
|
|
169
246
|
}
|
|
170
247
|
|
|
@@ -12,6 +12,14 @@ import { path } from '../internal/utils/path';
|
|
|
12
12
|
export class Monitors extends APIResource {
|
|
13
13
|
/**
|
|
14
14
|
* Create monitor
|
|
15
|
+
*
|
|
16
|
+
* @example
|
|
17
|
+
* ```ts
|
|
18
|
+
* const monitor = await client.monitors.create({
|
|
19
|
+
* eventTypes: ['tweet.new', 'follower.gained'],
|
|
20
|
+
* username: 'elonmusk',
|
|
21
|
+
* });
|
|
22
|
+
* ```
|
|
15
23
|
*/
|
|
16
24
|
create(body: MonitorCreateParams, options?: RequestOptions): APIPromise<MonitorCreateResponse> {
|
|
17
25
|
return this._client.post('/monitors', { body, ...options });
|
|
@@ -19,6 +27,11 @@ export class Monitors extends APIResource {
|
|
|
19
27
|
|
|
20
28
|
/**
|
|
21
29
|
* Get monitor
|
|
30
|
+
*
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* const monitor = await client.monitors.retrieve('id');
|
|
34
|
+
* ```
|
|
22
35
|
*/
|
|
23
36
|
retrieve(id: string, options?: RequestOptions): APIPromise<Monitor> {
|
|
24
37
|
return this._client.get(path`/monitors/${id}`, options);
|
|
@@ -26,6 +39,14 @@ export class Monitors extends APIResource {
|
|
|
26
39
|
|
|
27
40
|
/**
|
|
28
41
|
* Update monitor
|
|
42
|
+
*
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* const monitor = await client.monitors.update('id', {
|
|
46
|
+
* eventTypes: ['tweet.new'],
|
|
47
|
+
* isActive: true,
|
|
48
|
+
* });
|
|
49
|
+
* ```
|
|
29
50
|
*/
|
|
30
51
|
update(id: string, body: MonitorUpdateParams, options?: RequestOptions): APIPromise<Monitor> {
|
|
31
52
|
return this._client.patch(path`/monitors/${id}`, { body, ...options });
|
|
@@ -33,6 +54,11 @@ export class Monitors extends APIResource {
|
|
|
33
54
|
|
|
34
55
|
/**
|
|
35
56
|
* List monitors
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* const monitors = await client.monitors.list();
|
|
61
|
+
* ```
|
|
36
62
|
*/
|
|
37
63
|
list(options?: RequestOptions): APIPromise<MonitorListResponse> {
|
|
38
64
|
return this._client.get('/monitors', options);
|
|
@@ -40,17 +66,28 @@ export class Monitors extends APIResource {
|
|
|
40
66
|
|
|
41
67
|
/**
|
|
42
68
|
* Deactivate monitor
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```ts
|
|
72
|
+
* const response = await client.monitors.deactivate('id');
|
|
73
|
+
* ```
|
|
43
74
|
*/
|
|
44
75
|
deactivate(id: string, options?: RequestOptions): APIPromise<MonitorDeactivateResponse> {
|
|
45
76
|
return this._client.delete(path`/monitors/${id}`, options);
|
|
46
77
|
}
|
|
47
78
|
}
|
|
48
79
|
|
|
80
|
+
/**
|
|
81
|
+
* Account monitor that tracks activity for a given X user.
|
|
82
|
+
*/
|
|
49
83
|
export interface Monitor {
|
|
50
84
|
id: string;
|
|
51
85
|
|
|
52
86
|
createdAt: string;
|
|
53
87
|
|
|
88
|
+
/**
|
|
89
|
+
* Array of event types to subscribe to.
|
|
90
|
+
*/
|
|
54
91
|
eventTypes: Array<Shared.EventType>;
|
|
55
92
|
|
|
56
93
|
isActive: boolean;
|
|
@@ -65,6 +102,9 @@ export interface MonitorCreateResponse {
|
|
|
65
102
|
|
|
66
103
|
createdAt: string;
|
|
67
104
|
|
|
105
|
+
/**
|
|
106
|
+
* Array of event types to subscribe to.
|
|
107
|
+
*/
|
|
68
108
|
eventTypes: Array<Shared.EventType>;
|
|
69
109
|
|
|
70
110
|
username: string;
|
|
@@ -83,6 +123,9 @@ export interface MonitorDeactivateResponse {
|
|
|
83
123
|
}
|
|
84
124
|
|
|
85
125
|
export interface MonitorCreateParams {
|
|
126
|
+
/**
|
|
127
|
+
* Array of event types to subscribe to.
|
|
128
|
+
*/
|
|
86
129
|
eventTypes: Array<Shared.EventType>;
|
|
87
130
|
|
|
88
131
|
/**
|
|
@@ -92,6 +135,9 @@ export interface MonitorCreateParams {
|
|
|
92
135
|
}
|
|
93
136
|
|
|
94
137
|
export interface MonitorUpdateParams {
|
|
138
|
+
/**
|
|
139
|
+
* Array of event types to subscribe to.
|
|
140
|
+
*/
|
|
95
141
|
eventTypes?: Array<Shared.EventType>;
|
|
96
142
|
|
|
97
143
|
isActive?: boolean;
|
package/src/resources/radar.ts
CHANGED
|
@@ -19,6 +19,9 @@ export class Radar extends APIResource {
|
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
21
|
|
|
22
|
+
/**
|
|
23
|
+
* Trending topic with score, category, source, and region.
|
|
24
|
+
*/
|
|
22
25
|
export interface RadarItem {
|
|
23
26
|
category: string;
|
|
24
27
|
|
|
@@ -70,7 +73,7 @@ export interface RadarRetrieveTrendingTopicsParams {
|
|
|
70
73
|
* Source filter. One of: github, google_trends, hacker_news, polymarket, reddit,
|
|
71
74
|
* trustmrr, wikipedia
|
|
72
75
|
*/
|
|
73
|
-
source?:
|
|
76
|
+
source?: 'github' | 'google_trends' | 'hacker_news' | 'polymarket' | 'reddit' | 'trustmrr' | 'wikipedia';
|
|
74
77
|
}
|
|
75
78
|
|
|
76
79
|
export declare namespace Radar {
|
package/src/resources/shared.ts
CHANGED
|
@@ -3,6 +3,9 @@
|
|
|
3
3
|
import * as TweetsAPI from './x/tweets/tweets';
|
|
4
4
|
import * as UsersAPI from './x/users/users';
|
|
5
5
|
|
|
6
|
+
/**
|
|
7
|
+
* Error response containing a machine-readable error code.
|
|
8
|
+
*/
|
|
6
9
|
export interface Error {
|
|
7
10
|
error:
|
|
8
11
|
| 'internal_error'
|
|
@@ -32,6 +35,9 @@ export interface Error {
|
|
|
32
35
|
| 'x_api_unauthorized';
|
|
33
36
|
}
|
|
34
37
|
|
|
38
|
+
/**
|
|
39
|
+
* Type of monitor event fired when account activity occurs.
|
|
40
|
+
*/
|
|
35
41
|
export type EventType =
|
|
36
42
|
| 'tweet.new'
|
|
37
43
|
| 'tweet.reply'
|
|
@@ -40,6 +46,9 @@ export type EventType =
|
|
|
40
46
|
| 'follower.gained'
|
|
41
47
|
| 'follower.lost';
|
|
42
48
|
|
|
49
|
+
/**
|
|
50
|
+
* Paginated list of tweets with cursor-based navigation.
|
|
51
|
+
*/
|
|
43
52
|
export interface PaginatedTweets {
|
|
44
53
|
has_next_page: boolean;
|
|
45
54
|
|
|
@@ -48,6 +57,9 @@ export interface PaginatedTweets {
|
|
|
48
57
|
tweets: Array<TweetsAPI.SearchTweet>;
|
|
49
58
|
}
|
|
50
59
|
|
|
60
|
+
/**
|
|
61
|
+
* Paginated list of user profiles with cursor-based navigation.
|
|
62
|
+
*/
|
|
51
63
|
export interface PaginatedUsers {
|
|
52
64
|
has_next_page: boolean;
|
|
53
65
|
|