x-twitter-scraper 0.2.1 → 0.3.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 +28 -0
- package/client.d.mts +14 -27
- package/client.d.mts.map +1 -1
- package/client.d.ts +14 -27
- package/client.d.ts.map +1 -1
- package/client.js +12 -27
- package/client.js.map +1 -1
- package/client.mjs +12 -27
- package/client.mjs.map +1 -1
- package/internal/request-options.d.mts +0 -4
- package/internal/request-options.d.mts.map +1 -1
- package/internal/request-options.d.ts +0 -4
- package/internal/request-options.d.ts.map +1 -1
- package/internal/request-options.js.map +1 -1
- package/internal/request-options.mjs.map +1 -1
- package/internal/utils/env.js +2 -2
- package/internal/utils/env.js.map +1 -1
- package/internal/utils/env.mjs +2 -2
- package/internal/utils/env.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/account.d.mts +7 -6
- package/resources/account.d.mts.map +1 -1
- package/resources/account.d.ts +7 -6
- package/resources/account.d.ts.map +1 -1
- package/resources/account.js +3 -3
- package/resources/account.js.map +1 -1
- package/resources/account.mjs +3 -3
- package/resources/account.mjs.map +1 -1
- package/resources/api-keys.js +3 -3
- package/resources/api-keys.js.map +1 -1
- package/resources/api-keys.mjs +3 -3
- package/resources/api-keys.mjs.map +1 -1
- package/resources/compose.d.mts +1 -1
- package/resources/compose.d.ts +1 -1
- package/resources/compose.js +1 -1
- package/resources/compose.mjs +1 -1
- package/resources/credits.d.mts +1 -1
- package/resources/credits.d.ts +1 -1
- package/resources/credits.js +1 -1
- package/resources/credits.mjs +1 -1
- package/resources/drafts.d.mts +1 -1
- package/resources/drafts.d.ts +1 -1
- package/resources/drafts.js +1 -1
- package/resources/drafts.mjs +1 -1
- package/resources/events.js +1 -1
- package/resources/events.js.map +1 -1
- package/resources/events.mjs +1 -1
- package/resources/events.mjs.map +1 -1
- package/resources/extractions.d.mts +3 -2
- package/resources/extractions.d.mts.map +1 -1
- package/resources/extractions.d.ts +3 -2
- package/resources/extractions.d.ts.map +1 -1
- package/resources/index.d.mts +1 -3
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -3
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +1 -5
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +0 -2
- package/resources/index.mjs.map +1 -1
- package/resources/monitors.d.mts +1 -1
- package/resources/monitors.d.ts +1 -1
- package/resources/monitors.js +1 -1
- package/resources/monitors.mjs +1 -1
- package/resources/radar.d.mts +45 -10
- package/resources/radar.d.mts.map +1 -1
- package/resources/radar.d.ts +45 -10
- package/resources/radar.d.ts.map +1 -1
- package/resources/radar.js +1 -1
- package/resources/radar.mjs +1 -1
- package/resources/shared.d.mts +47 -6
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +47 -6
- package/resources/shared.d.ts.map +1 -1
- package/resources/styles.d.mts +1 -1
- package/resources/styles.d.ts +1 -1
- package/resources/styles.js +1 -1
- package/resources/styles.mjs +1 -1
- package/resources/subscribe.d.mts +1 -1
- package/resources/subscribe.d.ts +1 -1
- package/resources/subscribe.js +1 -1
- package/resources/subscribe.mjs +1 -1
- package/resources/trends.d.mts +2 -2
- package/resources/trends.d.ts +2 -2
- package/resources/trends.js +2 -2
- package/resources/trends.mjs +2 -2
- package/resources/webhooks.d.mts +2 -2
- package/resources/webhooks.d.ts +2 -2
- package/resources/webhooks.js +2 -2
- package/resources/webhooks.mjs +2 -2
- package/resources/x/accounts.d.mts +48 -0
- package/resources/x/accounts.d.mts.map +1 -1
- package/resources/x/accounts.d.ts +48 -0
- package/resources/x/accounts.d.ts.map +1 -1
- package/resources/x/accounts.js +6 -10
- package/resources/x/accounts.js.map +1 -1
- package/resources/x/accounts.mjs +6 -10
- package/resources/x/accounts.mjs.map +1 -1
- package/resources/x/bookmarks.d.mts +1 -1
- package/resources/x/bookmarks.d.ts +1 -1
- package/resources/x/bookmarks.js +1 -1
- package/resources/x/bookmarks.mjs +1 -1
- package/resources/x/communities/communities.d.mts +4 -4
- package/resources/x/communities/communities.d.ts +4 -4
- package/resources/x/communities/communities.js +4 -4
- package/resources/x/communities/communities.mjs +4 -4
- package/resources/x/communities/tweets.d.mts +3 -3
- package/resources/x/communities/tweets.d.ts +3 -3
- package/resources/x/communities/tweets.js +3 -3
- package/resources/x/communities/tweets.mjs +3 -3
- package/resources/x/followers.d.mts +2 -2
- package/resources/x/followers.d.ts +2 -2
- package/resources/x/followers.js +2 -2
- package/resources/x/followers.mjs +2 -2
- package/resources/x/index.d.mts +3 -3
- package/resources/x/index.d.mts.map +1 -1
- package/resources/x/index.d.ts +3 -3
- 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 +4 -4
- package/resources/x/lists.d.ts +4 -4
- package/resources/x/lists.js +4 -4
- package/resources/x/lists.mjs +4 -4
- package/resources/x/media.d.mts +2 -2
- package/resources/x/media.d.ts +2 -2
- package/resources/x/media.js +2 -2
- package/resources/x/media.mjs +2 -2
- package/resources/x/tweets/index.d.mts +1 -1
- package/resources/x/tweets/index.d.mts.map +1 -1
- package/resources/x/tweets/index.d.ts +1 -1
- package/resources/x/tweets/index.d.ts.map +1 -1
- package/resources/x/tweets/index.js.map +1 -1
- package/resources/x/tweets/index.mjs.map +1 -1
- package/resources/x/tweets/tweets.d.mts +19 -36
- package/resources/x/tweets/tweets.d.mts.map +1 -1
- package/resources/x/tweets/tweets.d.ts +19 -36
- package/resources/x/tweets/tweets.d.ts.map +1 -1
- package/resources/x/tweets/tweets.js +7 -7
- package/resources/x/tweets/tweets.js.map +1 -1
- package/resources/x/tweets/tweets.mjs +7 -7
- package/resources/x/tweets/tweets.mjs.map +1 -1
- package/resources/x/users/index.d.mts +1 -1
- package/resources/x/users/index.d.mts.map +1 -1
- package/resources/x/users/index.d.ts +1 -1
- package/resources/x/users/index.d.ts.map +1 -1
- package/resources/x/users/index.js.map +1 -1
- package/resources/x/users/index.mjs.map +1 -1
- package/resources/x/users/users.d.mts +13 -29
- package/resources/x/users/users.d.mts.map +1 -1
- package/resources/x/users/users.d.ts +13 -29
- package/resources/x/users/users.d.ts.map +1 -1
- package/resources/x/users/users.js +11 -11
- package/resources/x/users/users.js.map +1 -1
- package/resources/x/users/users.mjs +11 -11
- package/resources/x/users/users.mjs.map +1 -1
- package/resources/x/x.d.mts +17 -10
- package/resources/x/x.d.mts.map +1 -1
- package/resources/x/x.d.ts +17 -10
- package/resources/x/x.d.ts.map +1 -1
- package/resources/x/x.js +3 -6
- package/resources/x/x.js.map +1 -1
- package/resources/x/x.mjs +3 -6
- package/resources/x/x.mjs.map +1 -1
- package/src/client.ts +16 -56
- package/src/internal/request-options.ts +0 -2
- package/src/internal/utils/env.ts +2 -2
- package/src/resources/account.ts +10 -8
- package/src/resources/api-keys.ts +3 -3
- package/src/resources/compose.ts +1 -1
- package/src/resources/credits.ts +1 -1
- package/src/resources/drafts.ts +1 -1
- package/src/resources/events.ts +1 -1
- package/src/resources/extractions.ts +5 -3
- package/src/resources/index.ts +1 -13
- package/src/resources/monitors.ts +1 -1
- package/src/resources/radar.ts +50 -10
- package/src/resources/shared.ts +74 -14
- package/src/resources/styles.ts +1 -1
- package/src/resources/subscribe.ts +1 -1
- package/src/resources/trends.ts +2 -2
- package/src/resources/webhooks.ts +2 -2
- package/src/resources/x/accounts.ts +65 -10
- package/src/resources/x/bookmarks.ts +1 -1
- package/src/resources/x/communities/communities.ts +4 -4
- package/src/resources/x/communities/tweets.ts +3 -3
- package/src/resources/x/followers.ts +2 -2
- package/src/resources/x/index.ts +1 -2
- package/src/resources/x/lists.ts +4 -4
- package/src/resources/x/media.ts +2 -2
- package/src/resources/x/tweets/index.ts +0 -1
- package/src/resources/x/tweets/tweets.ts +20 -52
- package/src/resources/x/users/index.ts +0 -1
- package/src/resources/x/users/users.ts +12 -40
- package/src/resources/x/x.ts +19 -10
- 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/resources/x/x.mjs
CHANGED
|
@@ -21,9 +21,6 @@ import { Tweets, } from "./tweets/tweets.mjs";
|
|
|
21
21
|
import * as UsersAPI from "./users/users.mjs";
|
|
22
22
|
import { Users, } from "./users/users.mjs";
|
|
23
23
|
import { path } from "../../internal/utils/path.mjs";
|
|
24
|
-
/**
|
|
25
|
-
* X data lookups (subscription required)
|
|
26
|
-
*/
|
|
27
24
|
export class X extends APIResource {
|
|
28
25
|
constructor() {
|
|
29
26
|
super(...arguments);
|
|
@@ -72,15 +69,15 @@ export class X extends APIResource {
|
|
|
72
69
|
return this._client.get('/x/notifications', { query, ...options });
|
|
73
70
|
}
|
|
74
71
|
/**
|
|
75
|
-
* Get trending topics
|
|
72
|
+
* Get trending hashtags and topics from X by region
|
|
76
73
|
*
|
|
77
74
|
* @example
|
|
78
75
|
* ```ts
|
|
79
76
|
* const response = await client.x.getTrends();
|
|
80
77
|
* ```
|
|
81
78
|
*/
|
|
82
|
-
getTrends(options) {
|
|
83
|
-
return this._client.get('/x/trends', options);
|
|
79
|
+
getTrends(query = {}, options) {
|
|
80
|
+
return this._client.get('/x/trends', { query, ...options });
|
|
84
81
|
}
|
|
85
82
|
}
|
|
86
83
|
X.Tweets = Tweets;
|
package/resources/x/x.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"x.mjs","sourceRoot":"","sources":["../../src/resources/x/x.ts"],"names":[],"mappings":"AAAA,sFAAsF;OAE/E,EAAE,WAAW,EAAE;OAEf,KAAK,WAAW;OAChB,EAQL,QAAQ,GAGT;OACM,KAAK,YAAY;OACjB,EAAuD,SAAS,EAAE;OAClE,KAAK,KAAK;OACV,EAAE,EAAE,EAAoF;OACxF,KAAK,YAAY;OACjB,EAA8C,SAAS,EAAE;OACzD,KAAK,QAAQ;OACb,EAIL,KAAK,GACN;OACM,KAAK,QAAQ;OACb,EACL,KAAK,GAKN;OACM,KAAK,UAAU;OACf,EACL,OAAO,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B,CAAC,CAAC,WAAW,GAAG,WAAW,CAAC;AAC5B,CAAC,CAAC,QAAQ,GAAG,QAAQ,CAAC;AACtB,CAAC,CAAC,SAAS,GAAG,SAAS,CAAC;AACxB,CAAC,CAAC,KAAK,GAAG,KAAK,CAAC"}
|
package/src/client.ts
CHANGED
|
@@ -74,18 +74,6 @@ import {
|
|
|
74
74
|
ExtractionRunResponse,
|
|
75
75
|
Extractions,
|
|
76
76
|
} from './resources/extractions';
|
|
77
|
-
import {
|
|
78
|
-
Integration,
|
|
79
|
-
IntegrationCreateParams,
|
|
80
|
-
IntegrationDeleteResponse,
|
|
81
|
-
IntegrationDelivery,
|
|
82
|
-
IntegrationListDeliveriesParams,
|
|
83
|
-
IntegrationListDeliveriesResponse,
|
|
84
|
-
IntegrationListResponse,
|
|
85
|
-
IntegrationSendTestResponse,
|
|
86
|
-
IntegrationUpdateParams,
|
|
87
|
-
Integrations,
|
|
88
|
-
} from './resources/integrations';
|
|
89
77
|
import {
|
|
90
78
|
Monitor,
|
|
91
79
|
MonitorCreateParams,
|
|
@@ -126,7 +114,6 @@ import {
|
|
|
126
114
|
WebhookUpdateParams,
|
|
127
115
|
Webhooks,
|
|
128
116
|
} from './resources/webhooks';
|
|
129
|
-
import { Bot } from './resources/bot/bot';
|
|
130
117
|
import { Support } from './resources/support/support';
|
|
131
118
|
import {
|
|
132
119
|
X,
|
|
@@ -134,6 +121,7 @@ import {
|
|
|
134
121
|
XGetHomeTimelineParams,
|
|
135
122
|
XGetNotificationsParams,
|
|
136
123
|
XGetNotificationsResponse,
|
|
124
|
+
XGetTrendsParams,
|
|
137
125
|
XGetTrendsResponse,
|
|
138
126
|
} from './resources/x/x';
|
|
139
127
|
import { type Fetch } from './internal/builtin-types';
|
|
@@ -346,14 +334,8 @@ export class XTwitterScraper {
|
|
|
346
334
|
);
|
|
347
335
|
}
|
|
348
336
|
|
|
349
|
-
protected async authHeaders(
|
|
350
|
-
opts
|
|
351
|
-
schemes: { apiKeyAuth?: boolean; oauthBearerAuth?: boolean },
|
|
352
|
-
): Promise<NullableHeaders | undefined> {
|
|
353
|
-
return buildHeaders([
|
|
354
|
-
schemes.apiKeyAuth ? await this.apiKeyAuth(opts) : null,
|
|
355
|
-
schemes.oauthBearerAuth ? await this.oauthBearerAuth(opts) : null,
|
|
356
|
-
]);
|
|
337
|
+
protected async authHeaders(opts: FinalRequestOptions): Promise<NullableHeaders | undefined> {
|
|
338
|
+
return buildHeaders([await this.apiKeyAuth(opts), await this.oauthBearerAuth(opts)]);
|
|
357
339
|
}
|
|
358
340
|
|
|
359
341
|
protected async apiKeyAuth(opts: FinalRequestOptions): Promise<NullableHeaders | undefined> {
|
|
@@ -796,7 +778,7 @@ export class XTwitterScraper {
|
|
|
796
778
|
...(options.timeout ? { 'X-Stainless-Timeout': String(Math.trunc(options.timeout / 1000)) } : {}),
|
|
797
779
|
...getPlatformHeaders(),
|
|
798
780
|
},
|
|
799
|
-
await this.authHeaders(options
|
|
781
|
+
await this.authHeaders(options),
|
|
800
782
|
this._options.defaultHeaders,
|
|
801
783
|
bodyHeaders,
|
|
802
784
|
options.headers,
|
|
@@ -878,7 +860,7 @@ export class XTwitterScraper {
|
|
|
878
860
|
static toFile = Uploads.toFile;
|
|
879
861
|
|
|
880
862
|
/**
|
|
881
|
-
* Account info
|
|
863
|
+
* Account info and settings
|
|
882
864
|
*/
|
|
883
865
|
account: API.Account = new API.Account(this);
|
|
884
866
|
/**
|
|
@@ -886,23 +868,23 @@ export class XTwitterScraper {
|
|
|
886
868
|
*/
|
|
887
869
|
apiKeys: API.APIKeys = new API.APIKeys(this);
|
|
888
870
|
/**
|
|
889
|
-
* Subscription
|
|
871
|
+
* Subscription, billing, and credits
|
|
890
872
|
*/
|
|
891
873
|
subscribe: API.Subscribe = new API.Subscribe(this);
|
|
892
874
|
/**
|
|
893
|
-
*
|
|
875
|
+
* AI tweet composition, drafts, writing styles, and radar
|
|
894
876
|
*/
|
|
895
877
|
compose: API.Compose = new API.Compose(this);
|
|
896
878
|
/**
|
|
897
|
-
*
|
|
879
|
+
* AI tweet composition, drafts, writing styles, and radar
|
|
898
880
|
*/
|
|
899
881
|
drafts: API.Drafts = new API.Drafts(this);
|
|
900
882
|
/**
|
|
901
|
-
*
|
|
883
|
+
* AI tweet composition, drafts, writing styles, and radar
|
|
902
884
|
*/
|
|
903
885
|
styles: API.Styles = new API.Styles(this);
|
|
904
886
|
/**
|
|
905
|
-
*
|
|
887
|
+
* AI tweet composition, drafts, writing styles, and radar
|
|
906
888
|
*/
|
|
907
889
|
radar: API.Radar = new API.Radar(this);
|
|
908
890
|
/**
|
|
@@ -922,25 +904,17 @@ export class XTwitterScraper {
|
|
|
922
904
|
*/
|
|
923
905
|
draws: API.Draws = new API.Draws(this);
|
|
924
906
|
/**
|
|
925
|
-
* Webhook endpoint management
|
|
907
|
+
* Webhook endpoint management and delivery
|
|
926
908
|
*/
|
|
927
909
|
webhooks: API.Webhooks = new API.Webhooks(this);
|
|
928
|
-
/**
|
|
929
|
-
* Push notification integrations (Telegram)
|
|
930
|
-
*/
|
|
931
|
-
integrations: API.Integrations = new API.Integrations(this);
|
|
932
|
-
/**
|
|
933
|
-
* X data lookups (subscription required)
|
|
934
|
-
*/
|
|
935
910
|
x: API.X = new API.X(this);
|
|
936
911
|
/**
|
|
937
|
-
* Trending topics by region
|
|
912
|
+
* Trending topics and hashtags by region
|
|
938
913
|
*/
|
|
939
914
|
trends: API.Trends = new API.Trends(this);
|
|
940
|
-
bot: API.Bot = new API.Bot(this);
|
|
941
915
|
support: API.Support = new API.Support(this);
|
|
942
916
|
/**
|
|
943
|
-
* Subscription
|
|
917
|
+
* Subscription, billing, and credits
|
|
944
918
|
*/
|
|
945
919
|
credits: API.Credits = new API.Credits(this);
|
|
946
920
|
}
|
|
@@ -957,10 +931,8 @@ XTwitterScraper.Events = Events;
|
|
|
957
931
|
XTwitterScraper.Extractions = Extractions;
|
|
958
932
|
XTwitterScraper.Draws = Draws;
|
|
959
933
|
XTwitterScraper.Webhooks = Webhooks;
|
|
960
|
-
XTwitterScraper.Integrations = Integrations;
|
|
961
934
|
XTwitterScraper.X = X;
|
|
962
935
|
XTwitterScraper.Trends = Trends;
|
|
963
|
-
XTwitterScraper.Bot = Bot;
|
|
964
936
|
XTwitterScraper.Support = Support;
|
|
965
937
|
XTwitterScraper.Credits = Credits;
|
|
966
938
|
|
|
@@ -1079,19 +1051,6 @@ export declare namespace XTwitterScraper {
|
|
|
1079
1051
|
type WebhookUpdateParams as WebhookUpdateParams,
|
|
1080
1052
|
};
|
|
1081
1053
|
|
|
1082
|
-
export {
|
|
1083
|
-
Integrations as Integrations,
|
|
1084
|
-
type Integration as Integration,
|
|
1085
|
-
type IntegrationDelivery as IntegrationDelivery,
|
|
1086
|
-
type IntegrationListResponse as IntegrationListResponse,
|
|
1087
|
-
type IntegrationDeleteResponse as IntegrationDeleteResponse,
|
|
1088
|
-
type IntegrationListDeliveriesResponse as IntegrationListDeliveriesResponse,
|
|
1089
|
-
type IntegrationSendTestResponse as IntegrationSendTestResponse,
|
|
1090
|
-
type IntegrationCreateParams as IntegrationCreateParams,
|
|
1091
|
-
type IntegrationUpdateParams as IntegrationUpdateParams,
|
|
1092
|
-
type IntegrationListDeliveriesParams as IntegrationListDeliveriesParams,
|
|
1093
|
-
};
|
|
1094
|
-
|
|
1095
1054
|
export {
|
|
1096
1055
|
X as X,
|
|
1097
1056
|
type XGetArticleResponse as XGetArticleResponse,
|
|
@@ -1099,6 +1058,7 @@ export declare namespace XTwitterScraper {
|
|
|
1099
1058
|
type XGetTrendsResponse as XGetTrendsResponse,
|
|
1100
1059
|
type XGetHomeTimelineParams as XGetHomeTimelineParams,
|
|
1101
1060
|
type XGetNotificationsParams as XGetNotificationsParams,
|
|
1061
|
+
type XGetTrendsParams as XGetTrendsParams,
|
|
1102
1062
|
};
|
|
1103
1063
|
|
|
1104
1064
|
export {
|
|
@@ -1107,8 +1067,6 @@ export declare namespace XTwitterScraper {
|
|
|
1107
1067
|
type TrendListParams as TrendListParams,
|
|
1108
1068
|
};
|
|
1109
1069
|
|
|
1110
|
-
export { Bot as Bot };
|
|
1111
|
-
|
|
1112
1070
|
export { Support as Support };
|
|
1113
1071
|
|
|
1114
1072
|
export {
|
|
@@ -1122,4 +1080,6 @@ export declare namespace XTwitterScraper {
|
|
|
1122
1080
|
export type EventType = API.EventType;
|
|
1123
1081
|
export type PaginatedTweets = API.PaginatedTweets;
|
|
1124
1082
|
export type PaginatedUsers = API.PaginatedUsers;
|
|
1083
|
+
export type SearchTweet = API.SearchTweet;
|
|
1084
|
+
export type UserProfile = API.UserProfile;
|
|
1125
1085
|
}
|
|
@@ -9,10 +9,10 @@
|
|
|
9
9
|
*/
|
|
10
10
|
export const readEnv = (env: string): string | undefined => {
|
|
11
11
|
if (typeof (globalThis as any).process !== 'undefined') {
|
|
12
|
-
return (globalThis as any).process.env?.[env]?.trim()
|
|
12
|
+
return (globalThis as any).process.env?.[env]?.trim() || undefined;
|
|
13
13
|
}
|
|
14
14
|
if (typeof (globalThis as any).Deno !== 'undefined') {
|
|
15
|
-
return (globalThis as any).Deno.env?.get?.(env)?.trim();
|
|
15
|
+
return (globalThis as any).Deno.env?.get?.(env)?.trim() || undefined;
|
|
16
16
|
}
|
|
17
17
|
return undefined;
|
|
18
18
|
};
|
package/src/resources/account.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { APIPromise } from '../core/api-promise';
|
|
|
5
5
|
import { RequestOptions } from '../internal/request-options';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
* Account info
|
|
8
|
+
* Account info and settings
|
|
9
9
|
*/
|
|
10
10
|
export class Account extends APIResource {
|
|
11
11
|
/**
|
|
@@ -17,7 +17,7 @@ export class Account extends APIResource {
|
|
|
17
17
|
* ```
|
|
18
18
|
*/
|
|
19
19
|
retrieve(options?: RequestOptions): APIPromise<AccountRetrieveResponse> {
|
|
20
|
-
return this._client.get('/account',
|
|
20
|
+
return this._client.get('/account', options);
|
|
21
21
|
}
|
|
22
22
|
|
|
23
23
|
/**
|
|
@@ -51,7 +51,7 @@ export class Account extends APIResource {
|
|
|
51
51
|
body: AccountUpdateLocaleParams,
|
|
52
52
|
options?: RequestOptions,
|
|
53
53
|
): APIPromise<AccountUpdateLocaleResponse> {
|
|
54
|
-
return this._client.patch('/account', { body, ...options
|
|
54
|
+
return this._client.patch('/account', { body, ...options });
|
|
55
55
|
}
|
|
56
56
|
}
|
|
57
57
|
|
|
@@ -62,16 +62,18 @@ export interface AccountRetrieveResponse {
|
|
|
62
62
|
|
|
63
63
|
plan: 'active' | 'inactive';
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
creditInfo?: AccountRetrieveResponse.CreditInfo;
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
export namespace AccountRetrieveResponse {
|
|
69
|
-
export interface
|
|
70
|
-
|
|
69
|
+
export interface CreditInfo {
|
|
70
|
+
autoTopupEnabled: boolean;
|
|
71
71
|
|
|
72
|
-
|
|
72
|
+
balance: number;
|
|
73
73
|
|
|
74
|
-
|
|
74
|
+
lifetimePurchased: number;
|
|
75
|
+
|
|
76
|
+
lifetimeUsed: number;
|
|
75
77
|
}
|
|
76
78
|
}
|
|
77
79
|
|
|
@@ -20,7 +20,7 @@ export class APIKeys extends APIResource {
|
|
|
20
20
|
* ```
|
|
21
21
|
*/
|
|
22
22
|
create(body: APIKeyCreateParams, options?: RequestOptions): APIPromise<APIKeyCreateResponse> {
|
|
23
|
-
return this._client.post('/api-keys', { body, ...options
|
|
23
|
+
return this._client.post('/api-keys', { body, ...options });
|
|
24
24
|
}
|
|
25
25
|
|
|
26
26
|
/**
|
|
@@ -32,7 +32,7 @@ export class APIKeys extends APIResource {
|
|
|
32
32
|
* ```
|
|
33
33
|
*/
|
|
34
34
|
list(options?: RequestOptions): APIPromise<APIKeyListResponse> {
|
|
35
|
-
return this._client.get('/api-keys',
|
|
35
|
+
return this._client.get('/api-keys', options);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
/**
|
|
@@ -44,7 +44,7 @@ export class APIKeys extends APIResource {
|
|
|
44
44
|
* ```
|
|
45
45
|
*/
|
|
46
46
|
revoke(id: string, options?: RequestOptions): APIPromise<APIKeyRevokeResponse> {
|
|
47
|
-
return this._client.delete(path`/api-keys/${id}`,
|
|
47
|
+
return this._client.delete(path`/api-keys/${id}`, options);
|
|
48
48
|
}
|
|
49
49
|
}
|
|
50
50
|
|
package/src/resources/compose.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { APIPromise } from '../core/api-promise';
|
|
|
5
5
|
import { RequestOptions } from '../internal/request-options';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* AI tweet composition, drafts, writing styles, and radar
|
|
9
9
|
*/
|
|
10
10
|
export class Compose extends APIResource {
|
|
11
11
|
/**
|
package/src/resources/credits.ts
CHANGED
package/src/resources/drafts.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { RequestOptions } from '../internal/request-options';
|
|
|
7
7
|
import { path } from '../internal/utils/path';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* AI tweet composition, drafts, writing styles, and radar
|
|
11
11
|
*/
|
|
12
12
|
export class Drafts extends APIResource {
|
|
13
13
|
/**
|
package/src/resources/events.ts
CHANGED
|
@@ -24,7 +24,7 @@ export class Events extends APIResource {
|
|
|
24
24
|
query: EventListParams | null | undefined = {},
|
|
25
25
|
options?: RequestOptions,
|
|
26
26
|
): APIPromise<EventListResponse> {
|
|
27
|
-
return this._client.get('/events', { query, ...options
|
|
27
|
+
return this._client.get('/events', { query, ...options });
|
|
28
28
|
}
|
|
29
29
|
}
|
|
30
30
|
|
|
@@ -165,13 +165,15 @@ export interface ExtractionListResponse {
|
|
|
165
165
|
export interface ExtractionEstimateCostResponse {
|
|
166
166
|
allowed: boolean;
|
|
167
167
|
|
|
168
|
-
|
|
168
|
+
creditsAvailable: string;
|
|
169
|
+
|
|
170
|
+
creditsRequired: string;
|
|
169
171
|
|
|
170
|
-
|
|
172
|
+
estimatedResults: number;
|
|
171
173
|
|
|
172
174
|
source: string;
|
|
173
175
|
|
|
174
|
-
|
|
176
|
+
resolvedXUserId?: string;
|
|
175
177
|
}
|
|
176
178
|
|
|
177
179
|
export interface ExtractionRunResponse {
|
package/src/resources/index.ts
CHANGED
|
@@ -17,7 +17,6 @@ export {
|
|
|
17
17
|
type AccountSetXUsernameParams,
|
|
18
18
|
type AccountUpdateLocaleParams,
|
|
19
19
|
} from './account';
|
|
20
|
-
export { Bot } from './bot/bot';
|
|
21
20
|
export { Compose, type ComposeCreateResponse, type ComposeCreateParams } from './compose';
|
|
22
21
|
export {
|
|
23
22
|
Credits,
|
|
@@ -59,18 +58,6 @@ export {
|
|
|
59
58
|
type ExtractionExportResultsParams,
|
|
60
59
|
type ExtractionRunParams,
|
|
61
60
|
} from './extractions';
|
|
62
|
-
export {
|
|
63
|
-
Integrations,
|
|
64
|
-
type Integration,
|
|
65
|
-
type IntegrationDelivery,
|
|
66
|
-
type IntegrationListResponse,
|
|
67
|
-
type IntegrationDeleteResponse,
|
|
68
|
-
type IntegrationListDeliveriesResponse,
|
|
69
|
-
type IntegrationSendTestResponse,
|
|
70
|
-
type IntegrationCreateParams,
|
|
71
|
-
type IntegrationUpdateParams,
|
|
72
|
-
type IntegrationListDeliveriesParams,
|
|
73
|
-
} from './integrations';
|
|
74
61
|
export {
|
|
75
62
|
Monitors,
|
|
76
63
|
type Monitor,
|
|
@@ -119,4 +106,5 @@ export {
|
|
|
119
106
|
type XGetTrendsResponse,
|
|
120
107
|
type XGetHomeTimelineParams,
|
|
121
108
|
type XGetNotificationsParams,
|
|
109
|
+
type XGetTrendsParams,
|
|
122
110
|
} from './x/x';
|
|
@@ -16,7 +16,7 @@ export class Monitors extends APIResource {
|
|
|
16
16
|
* @example
|
|
17
17
|
* ```ts
|
|
18
18
|
* const monitor = await client.monitors.create({
|
|
19
|
-
* eventTypes: ['tweet.new', '
|
|
19
|
+
* eventTypes: ['tweet.new', 'tweet.reply'],
|
|
20
20
|
* username: 'elonmusk',
|
|
21
21
|
* });
|
|
22
22
|
* ```
|
package/src/resources/radar.ts
CHANGED
|
@@ -5,7 +5,7 @@ import { APIPromise } from '../core/api-promise';
|
|
|
5
5
|
import { RequestOptions } from '../internal/request-options';
|
|
6
6
|
|
|
7
7
|
/**
|
|
8
|
-
*
|
|
8
|
+
* AI tweet composition, drafts, writing styles, and radar
|
|
9
9
|
*/
|
|
10
10
|
export class Radar extends APIResource {
|
|
11
11
|
/**
|
|
@@ -20,10 +20,35 @@ export class Radar extends APIResource {
|
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
/**
|
|
23
|
-
* Trending topic with score, category, source, and
|
|
23
|
+
* Trending topic with score, category, source, region, language, and
|
|
24
|
+
* source-specific metadata.
|
|
24
25
|
*/
|
|
25
26
|
export interface RadarItem {
|
|
26
|
-
|
|
27
|
+
/**
|
|
28
|
+
* Internal numeric identifier (stringified bigint).
|
|
29
|
+
*/
|
|
30
|
+
id: string;
|
|
31
|
+
|
|
32
|
+
category: 'general' | 'tech' | 'dev' | 'science' | 'culture' | 'politics' | 'business' | 'entertainment';
|
|
33
|
+
|
|
34
|
+
createdAt: string;
|
|
35
|
+
|
|
36
|
+
language: string;
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Source-specific fields. Shape varies per source:
|
|
40
|
+
*
|
|
41
|
+
* - reddit: { subreddit: string, author: string }
|
|
42
|
+
* - github: { starsToday: number }
|
|
43
|
+
* - hacker_news: { points: number, numberComments: number }
|
|
44
|
+
* - google_trends: { approxTraffic: number }
|
|
45
|
+
* - polymarket: { volume24hr: number }
|
|
46
|
+
* - wikipedia: { views: number }
|
|
47
|
+
* - trustmrr: { mrr, growthPercent, last30Days, total, customers,
|
|
48
|
+
* activeSubscriptions, onSale, xHandle?, category?, askingPrice?, country?,
|
|
49
|
+
* growthMrrPercent?, multiple?, paymentProvider?, rank? }
|
|
50
|
+
*/
|
|
51
|
+
metadata: { [key: string]: unknown };
|
|
27
52
|
|
|
28
53
|
publishedAt: string;
|
|
29
54
|
|
|
@@ -31,7 +56,12 @@ export interface RadarItem {
|
|
|
31
56
|
|
|
32
57
|
score: number;
|
|
33
58
|
|
|
34
|
-
source:
|
|
59
|
+
source: 'github' | 'google_trends' | 'hacker_news' | 'polymarket' | 'reddit' | 'trustmrr' | 'wikipedia';
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Source-specific identifier used for deduplication.
|
|
63
|
+
*/
|
|
64
|
+
sourceId: string;
|
|
35
65
|
|
|
36
66
|
title: string;
|
|
37
67
|
|
|
@@ -43,27 +73,37 @@ export interface RadarItem {
|
|
|
43
73
|
}
|
|
44
74
|
|
|
45
75
|
export interface RadarRetrieveTrendingTopicsResponse {
|
|
76
|
+
hasMore: boolean;
|
|
77
|
+
|
|
46
78
|
items: Array<RadarItem>;
|
|
47
79
|
|
|
48
|
-
|
|
80
|
+
/**
|
|
81
|
+
* Opaque cursor for the next page (present only when hasMore is true).
|
|
82
|
+
*/
|
|
83
|
+
nextCursor?: string;
|
|
49
84
|
}
|
|
50
85
|
|
|
51
86
|
export interface RadarRetrieveTrendingTopicsParams {
|
|
52
87
|
/**
|
|
53
|
-
*
|
|
88
|
+
* Cursor for pagination (from prior response nextCursor).
|
|
54
89
|
*/
|
|
55
|
-
|
|
90
|
+
after?: string;
|
|
56
91
|
|
|
57
92
|
/**
|
|
58
|
-
*
|
|
93
|
+
* Filter by category.
|
|
59
94
|
*/
|
|
60
|
-
|
|
95
|
+
category?: 'general' | 'tech' | 'dev' | 'science' | 'culture' | 'politics' | 'business' | 'entertainment';
|
|
61
96
|
|
|
62
97
|
/**
|
|
63
|
-
* Lookback window in hours
|
|
98
|
+
* Lookback window in hours (1-168, default 24).
|
|
64
99
|
*/
|
|
65
100
|
hours?: number;
|
|
66
101
|
|
|
102
|
+
/**
|
|
103
|
+
* Number of items to return (1-100, default 50).
|
|
104
|
+
*/
|
|
105
|
+
limit?: number;
|
|
106
|
+
|
|
67
107
|
/**
|
|
68
108
|
* Region filter (us, global, etc.)
|
|
69
109
|
*/
|
package/src/resources/shared.ts
CHANGED
|
@@ -1,8 +1,5 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
|
|
3
|
-
import * as TweetsAPI from './x/tweets/tweets';
|
|
4
|
-
import * as UsersAPI from './x/users/users';
|
|
5
|
-
|
|
6
3
|
/**
|
|
7
4
|
* Error response containing a machine-readable error code.
|
|
8
5
|
*/
|
|
@@ -17,17 +14,17 @@ export interface Error {
|
|
|
17
14
|
| 'invalid_tweet_id'
|
|
18
15
|
| 'invalid_tweet_url'
|
|
19
16
|
| 'invalid_username'
|
|
17
|
+
| 'insufficient_credits'
|
|
20
18
|
| 'missing_params'
|
|
21
19
|
| 'missing_query'
|
|
22
20
|
| 'monitor_already_exists'
|
|
23
21
|
| 'monitor_limit_reached'
|
|
22
|
+
| 'no_credits'
|
|
24
23
|
| 'no_subscription'
|
|
25
24
|
| 'not_found'
|
|
26
|
-
| 'stream_registration_failed'
|
|
27
25
|
| 'subscription_inactive'
|
|
28
26
|
| 'tweet_not_found'
|
|
29
27
|
| 'unauthenticated'
|
|
30
|
-
| 'usage_limit_reached'
|
|
31
28
|
| 'user_not_found'
|
|
32
29
|
| 'webhook_inactive'
|
|
33
30
|
| 'x_api_rate_limited'
|
|
@@ -38,13 +35,7 @@ export interface Error {
|
|
|
38
35
|
/**
|
|
39
36
|
* Type of monitor event fired when account activity occurs.
|
|
40
37
|
*/
|
|
41
|
-
export type EventType =
|
|
42
|
-
| 'tweet.new'
|
|
43
|
-
| 'tweet.reply'
|
|
44
|
-
| 'tweet.retweet'
|
|
45
|
-
| 'tweet.quote'
|
|
46
|
-
| 'follower.gained'
|
|
47
|
-
| 'follower.lost';
|
|
38
|
+
export type EventType = 'tweet.new' | 'tweet.reply' | 'tweet.retweet' | 'tweet.quote';
|
|
48
39
|
|
|
49
40
|
/**
|
|
50
41
|
* Paginated list of tweets with cursor-based navigation.
|
|
@@ -54,7 +45,7 @@ export interface PaginatedTweets {
|
|
|
54
45
|
|
|
55
46
|
next_cursor: string;
|
|
56
47
|
|
|
57
|
-
tweets: Array<
|
|
48
|
+
tweets: Array<SearchTweet>;
|
|
58
49
|
}
|
|
59
50
|
|
|
60
51
|
/**
|
|
@@ -65,5 +56,74 @@ export interface PaginatedUsers {
|
|
|
65
56
|
|
|
66
57
|
next_cursor: string;
|
|
67
58
|
|
|
68
|
-
users: Array<
|
|
59
|
+
users: Array<UserProfile>;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
/**
|
|
63
|
+
* Tweet returned from search results with inline author info.
|
|
64
|
+
*/
|
|
65
|
+
export interface SearchTweet {
|
|
66
|
+
id: string;
|
|
67
|
+
|
|
68
|
+
text: string;
|
|
69
|
+
|
|
70
|
+
author?: SearchTweet.Author;
|
|
71
|
+
|
|
72
|
+
bookmarkCount?: number;
|
|
73
|
+
|
|
74
|
+
createdAt?: string;
|
|
75
|
+
|
|
76
|
+
/**
|
|
77
|
+
* True for Note Tweets (long-form content, up to 25,000 characters)
|
|
78
|
+
*/
|
|
79
|
+
isNoteTweet?: boolean;
|
|
80
|
+
|
|
81
|
+
likeCount?: number;
|
|
82
|
+
|
|
83
|
+
quoteCount?: number;
|
|
84
|
+
|
|
85
|
+
replyCount?: number;
|
|
86
|
+
|
|
87
|
+
retweetCount?: number;
|
|
88
|
+
|
|
89
|
+
viewCount?: number;
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
export namespace SearchTweet {
|
|
93
|
+
export interface Author {
|
|
94
|
+
id: string;
|
|
95
|
+
|
|
96
|
+
name: string;
|
|
97
|
+
|
|
98
|
+
username: string;
|
|
99
|
+
|
|
100
|
+
verified?: boolean;
|
|
101
|
+
}
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* X user profile with bio, follower counts, and verification status.
|
|
106
|
+
*/
|
|
107
|
+
export interface UserProfile {
|
|
108
|
+
id: string;
|
|
109
|
+
|
|
110
|
+
name: string;
|
|
111
|
+
|
|
112
|
+
username: string;
|
|
113
|
+
|
|
114
|
+
createdAt?: string;
|
|
115
|
+
|
|
116
|
+
description?: string;
|
|
117
|
+
|
|
118
|
+
followers?: number;
|
|
119
|
+
|
|
120
|
+
following?: number;
|
|
121
|
+
|
|
122
|
+
location?: string;
|
|
123
|
+
|
|
124
|
+
profilePicture?: string;
|
|
125
|
+
|
|
126
|
+
statusesCount?: number;
|
|
127
|
+
|
|
128
|
+
verified?: boolean;
|
|
69
129
|
}
|
package/src/resources/styles.ts
CHANGED
|
@@ -7,7 +7,7 @@ import { RequestOptions } from '../internal/request-options';
|
|
|
7
7
|
import { path } from '../internal/utils/path';
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
|
-
*
|
|
10
|
+
* AI tweet composition, drafts, writing styles, and radar
|
|
11
11
|
*/
|
|
12
12
|
export class Styles extends APIResource {
|
|
13
13
|
/**
|