x-twitter-scraper 0.2.1 → 0.3.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 +36 -0
- package/README.md +51 -3
- 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 +31 -10
- 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/radar.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { APIResource } from "../core/resource.js";
|
|
|
2
2
|
import { APIPromise } from "../core/api-promise.js";
|
|
3
3
|
import { RequestOptions } from "../internal/request-options.js";
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* AI tweet composition, drafts, writing styles, and radar
|
|
6
6
|
*/
|
|
7
7
|
export declare class Radar extends APIResource {
|
|
8
8
|
/**
|
|
@@ -11,36 +11,71 @@ export declare class Radar extends APIResource {
|
|
|
11
11
|
retrieveTrendingTopics(query?: RadarRetrieveTrendingTopicsParams | null | undefined, options?: RequestOptions): APIPromise<RadarRetrieveTrendingTopicsResponse>;
|
|
12
12
|
}
|
|
13
13
|
/**
|
|
14
|
-
* Trending topic with score, category, source, and
|
|
14
|
+
* Trending topic with score, category, source, region, language, and
|
|
15
|
+
* source-specific metadata.
|
|
15
16
|
*/
|
|
16
17
|
export interface RadarItem {
|
|
17
|
-
|
|
18
|
+
/**
|
|
19
|
+
* Internal numeric identifier (stringified bigint).
|
|
20
|
+
*/
|
|
21
|
+
id: string;
|
|
22
|
+
category: 'general' | 'tech' | 'dev' | 'science' | 'culture' | 'politics' | 'business' | 'entertainment';
|
|
23
|
+
createdAt: string;
|
|
24
|
+
language: string;
|
|
25
|
+
/**
|
|
26
|
+
* Source-specific fields. Shape varies per source:
|
|
27
|
+
*
|
|
28
|
+
* - reddit: { subreddit: string, author: string }
|
|
29
|
+
* - github: { starsToday: number }
|
|
30
|
+
* - hacker_news: { points: number, numberComments: number }
|
|
31
|
+
* - google_trends: { approxTraffic: number }
|
|
32
|
+
* - polymarket: { volume24hr: number }
|
|
33
|
+
* - wikipedia: { views: number }
|
|
34
|
+
* - trustmrr: { mrr, growthPercent, last30Days, total, customers,
|
|
35
|
+
* activeSubscriptions, onSale, xHandle?, category?, askingPrice?, country?,
|
|
36
|
+
* growthMrrPercent?, multiple?, paymentProvider?, rank? }
|
|
37
|
+
*/
|
|
38
|
+
metadata: {
|
|
39
|
+
[key: string]: unknown;
|
|
40
|
+
};
|
|
18
41
|
publishedAt: string;
|
|
19
42
|
region: string;
|
|
20
43
|
score: number;
|
|
21
|
-
source:
|
|
44
|
+
source: 'github' | 'google_trends' | 'hacker_news' | 'polymarket' | 'reddit' | 'trustmrr' | 'wikipedia';
|
|
45
|
+
/**
|
|
46
|
+
* Source-specific identifier used for deduplication.
|
|
47
|
+
*/
|
|
48
|
+
sourceId: string;
|
|
22
49
|
title: string;
|
|
23
50
|
description?: string;
|
|
24
51
|
imageUrl?: string;
|
|
25
52
|
url?: string;
|
|
26
53
|
}
|
|
27
54
|
export interface RadarRetrieveTrendingTopicsResponse {
|
|
55
|
+
hasMore: boolean;
|
|
28
56
|
items: Array<RadarItem>;
|
|
29
|
-
|
|
57
|
+
/**
|
|
58
|
+
* Opaque cursor for the next page (present only when hasMore is true).
|
|
59
|
+
*/
|
|
60
|
+
nextCursor?: string;
|
|
30
61
|
}
|
|
31
62
|
export interface RadarRetrieveTrendingTopicsParams {
|
|
32
63
|
/**
|
|
33
|
-
*
|
|
64
|
+
* Cursor for pagination (from prior response nextCursor).
|
|
34
65
|
*/
|
|
35
|
-
|
|
66
|
+
after?: string;
|
|
36
67
|
/**
|
|
37
|
-
*
|
|
68
|
+
* Filter by category.
|
|
38
69
|
*/
|
|
39
|
-
|
|
70
|
+
category?: 'general' | 'tech' | 'dev' | 'science' | 'culture' | 'politics' | 'business' | 'entertainment';
|
|
40
71
|
/**
|
|
41
|
-
* Lookback window in hours
|
|
72
|
+
* Lookback window in hours (1-168, default 24).
|
|
42
73
|
*/
|
|
43
74
|
hours?: number;
|
|
75
|
+
/**
|
|
76
|
+
* Number of items to return (1-100, default 50).
|
|
77
|
+
*/
|
|
78
|
+
limit?: number;
|
|
44
79
|
/**
|
|
45
80
|
* Region filter (us, global, etc.)
|
|
46
81
|
*/
|
package/resources/radar.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"radar.d.ts","sourceRoot":"","sources":["../src/resources/radar.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB;;GAEG;AACH,qBAAa,KAAM,SAAQ,WAAW;IACpC;;OAEG;IACH,sBAAsB,CACpB,KAAK,GAAE,iCAAiC,GAAG,IAAI,GAAG,SAAc,EAChE,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,mCAAmC,CAAC;CAGnD;AAED
|
|
1
|
+
{"version":3,"file":"radar.d.ts","sourceRoot":"","sources":["../src/resources/radar.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAEzB;;GAEG;AACH,qBAAa,KAAM,SAAQ,WAAW;IACpC;;OAEG;IACH,sBAAsB,CACpB,KAAK,GAAE,iCAAiC,GAAG,IAAI,GAAG,SAAc,EAChE,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,mCAAmC,CAAC;CAGnD;AAED;;;GAGG;AACH,MAAM,WAAW,SAAS;IACxB;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX,QAAQ,EAAE,SAAS,GAAG,MAAM,GAAG,KAAK,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,eAAe,CAAC;IAEzG,SAAS,EAAE,MAAM,CAAC;IAElB,QAAQ,EAAE,MAAM,CAAC;IAEjB;;;;;;;;;;;;OAYG;IACH,QAAQ,EAAE;QAAE,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO,CAAA;KAAE,CAAC;IAErC,WAAW,EAAE,MAAM,CAAC;IAEpB,MAAM,EAAE,MAAM,CAAC;IAEf,KAAK,EAAE,MAAM,CAAC;IAEd,MAAM,EAAE,QAAQ,GAAG,eAAe,GAAG,aAAa,GAAG,YAAY,GAAG,QAAQ,GAAG,UAAU,GAAG,WAAW,CAAC;IAExG;;OAEG;IACH,QAAQ,EAAE,MAAM,CAAC;IAEjB,KAAK,EAAE,MAAM,CAAC;IAEd,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,GAAG,CAAC,EAAE,MAAM,CAAC;CACd;AAED,MAAM,WAAW,mCAAmC;IAClD,OAAO,EAAE,OAAO,CAAC;IAEjB,KAAK,EAAE,KAAK,CAAC,SAAS,CAAC,CAAC;IAExB;;OAEG;IACH,UAAU,CAAC,EAAE,MAAM,CAAC;CACrB;AAED,MAAM,WAAW,iCAAiC;IAChD;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,QAAQ,CAAC,EAAE,SAAS,GAAG,MAAM,GAAG,KAAK,GAAG,SAAS,GAAG,SAAS,GAAG,UAAU,GAAG,UAAU,GAAG,eAAe,CAAC;IAE1G;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,MAAM,CAAC,EAAE,QAAQ,GAAG,eAAe,GAAG,aAAa,GAAG,YAAY,GAAG,QAAQ,GAAG,UAAU,GAAG,WAAW,CAAC;CAC1G;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,SAAS,IAAI,SAAS,EAC3B,KAAK,mCAAmC,IAAI,mCAAmC,EAC/E,KAAK,iCAAiC,IAAI,iCAAiC,GAC5E,CAAC;CACH"}
|
package/resources/radar.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
exports.Radar = void 0;
|
|
5
5
|
const resource_1 = require("../core/resource.js");
|
|
6
6
|
/**
|
|
7
|
-
*
|
|
7
|
+
* AI tweet composition, drafts, writing styles, and radar
|
|
8
8
|
*/
|
|
9
9
|
class Radar extends resource_1.APIResource {
|
|
10
10
|
/**
|
package/resources/radar.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
import { APIResource } from "../core/resource.mjs";
|
|
3
3
|
/**
|
|
4
|
-
*
|
|
4
|
+
* AI tweet composition, drafts, writing styles, and radar
|
|
5
5
|
*/
|
|
6
6
|
export class Radar extends APIResource {
|
|
7
7
|
/**
|
package/resources/shared.d.mts
CHANGED
|
@@ -1,22 +1,20 @@
|
|
|
1
|
-
import * as TweetsAPI from "./x/tweets/tweets.mjs";
|
|
2
|
-
import * as UsersAPI from "./x/users/users.mjs";
|
|
3
1
|
/**
|
|
4
2
|
* Error response containing a machine-readable error code.
|
|
5
3
|
*/
|
|
6
4
|
export interface Error {
|
|
7
|
-
error: 'internal_error' | 'invalid_format' | 'invalid_id' | 'invalid_input' | 'invalid_params' | 'invalid_tool_type' | 'invalid_tweet_id' | 'invalid_tweet_url' | 'invalid_username' | 'missing_params' | 'missing_query' | 'monitor_already_exists' | 'monitor_limit_reached' | '
|
|
5
|
+
error: 'internal_error' | 'invalid_format' | 'invalid_id' | 'invalid_input' | 'invalid_params' | 'invalid_tool_type' | 'invalid_tweet_id' | 'invalid_tweet_url' | 'invalid_username' | 'insufficient_credits' | 'missing_params' | 'missing_query' | 'monitor_already_exists' | 'monitor_limit_reached' | 'no_credits' | 'no_subscription' | 'not_found' | 'subscription_inactive' | 'tweet_not_found' | 'unauthenticated' | 'user_not_found' | 'webhook_inactive' | 'x_api_rate_limited' | 'x_api_unavailable' | 'x_api_unauthorized';
|
|
8
6
|
}
|
|
9
7
|
/**
|
|
10
8
|
* Type of monitor event fired when account activity occurs.
|
|
11
9
|
*/
|
|
12
|
-
export type EventType = 'tweet.new' | 'tweet.reply' | 'tweet.retweet' | 'tweet.quote'
|
|
10
|
+
export type EventType = 'tweet.new' | 'tweet.reply' | 'tweet.retweet' | 'tweet.quote';
|
|
13
11
|
/**
|
|
14
12
|
* Paginated list of tweets with cursor-based navigation.
|
|
15
13
|
*/
|
|
16
14
|
export interface PaginatedTweets {
|
|
17
15
|
has_next_page: boolean;
|
|
18
16
|
next_cursor: string;
|
|
19
|
-
tweets: Array<
|
|
17
|
+
tweets: Array<SearchTweet>;
|
|
20
18
|
}
|
|
21
19
|
/**
|
|
22
20
|
* Paginated list of user profiles with cursor-based navigation.
|
|
@@ -24,6 +22,49 @@ export interface PaginatedTweets {
|
|
|
24
22
|
export interface PaginatedUsers {
|
|
25
23
|
has_next_page: boolean;
|
|
26
24
|
next_cursor: string;
|
|
27
|
-
users: Array<
|
|
25
|
+
users: Array<UserProfile>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Tweet returned from search results with inline author info.
|
|
29
|
+
*/
|
|
30
|
+
export interface SearchTweet {
|
|
31
|
+
id: string;
|
|
32
|
+
text: string;
|
|
33
|
+
author?: SearchTweet.Author;
|
|
34
|
+
bookmarkCount?: number;
|
|
35
|
+
createdAt?: string;
|
|
36
|
+
/**
|
|
37
|
+
* True for Note Tweets (long-form content, up to 25,000 characters)
|
|
38
|
+
*/
|
|
39
|
+
isNoteTweet?: boolean;
|
|
40
|
+
likeCount?: number;
|
|
41
|
+
quoteCount?: number;
|
|
42
|
+
replyCount?: number;
|
|
43
|
+
retweetCount?: number;
|
|
44
|
+
viewCount?: number;
|
|
45
|
+
}
|
|
46
|
+
export declare namespace SearchTweet {
|
|
47
|
+
interface Author {
|
|
48
|
+
id: string;
|
|
49
|
+
name: string;
|
|
50
|
+
username: string;
|
|
51
|
+
verified?: boolean;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* X user profile with bio, follower counts, and verification status.
|
|
56
|
+
*/
|
|
57
|
+
export interface UserProfile {
|
|
58
|
+
id: string;
|
|
59
|
+
name: string;
|
|
60
|
+
username: string;
|
|
61
|
+
createdAt?: string;
|
|
62
|
+
description?: string;
|
|
63
|
+
followers?: number;
|
|
64
|
+
following?: number;
|
|
65
|
+
location?: string;
|
|
66
|
+
profilePicture?: string;
|
|
67
|
+
statusesCount?: number;
|
|
68
|
+
verified?: boolean;
|
|
28
69
|
}
|
|
29
70
|
//# sourceMappingURL=shared.d.mts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.mts","sourceRoot":"","sources":["../src/resources/shared.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shared.d.mts","sourceRoot":"","sources":["../src/resources/shared.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB,KAAK,EACD,gBAAgB,GAChB,gBAAgB,GAChB,YAAY,GACZ,eAAe,GACf,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,mBAAmB,GACnB,kBAAkB,GAClB,sBAAsB,GACtB,gBAAgB,GAChB,eAAe,GACf,wBAAwB,GACxB,uBAAuB,GACvB,YAAY,GACZ,iBAAiB,GACjB,WAAW,GACX,uBAAuB,GACvB,iBAAiB,GACjB,iBAAiB,GACjB,gBAAgB,GAChB,kBAAkB,GAClB,oBAAoB,GACpB,mBAAmB,GACnB,oBAAoB,CAAC;CAC1B;AAED;;GAEG;AACH,MAAM,MAAM,SAAS,GAAG,WAAW,GAAG,aAAa,GAAG,eAAe,GAAG,aAAa,CAAC;AAEtF;;GAEG;AACH,MAAM,WAAW,eAAe;IAC9B,aAAa,EAAE,OAAO,CAAC;IAEvB,WAAW,EAAE,MAAM,CAAC;IAEpB,MAAM,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;CAC5B;AAED;;GAEG;AACH,MAAM,WAAW,cAAc;IAC7B,aAAa,EAAE,OAAO,CAAC;IAEvB,WAAW,EAAE,MAAM,CAAC;IAEpB,KAAK,EAAE,KAAK,CAAC,WAAW,CAAC,CAAC;CAC3B;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IAEX,IAAI,EAAE,MAAM,CAAC;IAEb,MAAM,CAAC,EAAE,WAAW,CAAC,MAAM,CAAC;IAE5B,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB;;OAEG;IACH,WAAW,CAAC,EAAE,OAAO,CAAC;IAEtB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB,SAAS,CAAC,EAAE,MAAM,CAAC;CACpB;AAED,yBAAiB,WAAW,CAAC;IAC3B,UAAiB,MAAM;QACrB,EAAE,EAAE,MAAM,CAAC;QAEX,IAAI,EAAE,MAAM,CAAC;QAEb,QAAQ,EAAE,MAAM,CAAC;QAEjB,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB;CACF;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IAEX,IAAI,EAAE,MAAM,CAAC;IAEb,QAAQ,EAAE,MAAM,CAAC;IAEjB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
package/resources/shared.d.ts
CHANGED
|
@@ -1,22 +1,20 @@
|
|
|
1
|
-
import * as TweetsAPI from "./x/tweets/tweets.js";
|
|
2
|
-
import * as UsersAPI from "./x/users/users.js";
|
|
3
1
|
/**
|
|
4
2
|
* Error response containing a machine-readable error code.
|
|
5
3
|
*/
|
|
6
4
|
export interface Error {
|
|
7
|
-
error: 'internal_error' | 'invalid_format' | 'invalid_id' | 'invalid_input' | 'invalid_params' | 'invalid_tool_type' | 'invalid_tweet_id' | 'invalid_tweet_url' | 'invalid_username' | 'missing_params' | 'missing_query' | 'monitor_already_exists' | 'monitor_limit_reached' | '
|
|
5
|
+
error: 'internal_error' | 'invalid_format' | 'invalid_id' | 'invalid_input' | 'invalid_params' | 'invalid_tool_type' | 'invalid_tweet_id' | 'invalid_tweet_url' | 'invalid_username' | 'insufficient_credits' | 'missing_params' | 'missing_query' | 'monitor_already_exists' | 'monitor_limit_reached' | 'no_credits' | 'no_subscription' | 'not_found' | 'subscription_inactive' | 'tweet_not_found' | 'unauthenticated' | 'user_not_found' | 'webhook_inactive' | 'x_api_rate_limited' | 'x_api_unavailable' | 'x_api_unauthorized';
|
|
8
6
|
}
|
|
9
7
|
/**
|
|
10
8
|
* Type of monitor event fired when account activity occurs.
|
|
11
9
|
*/
|
|
12
|
-
export type EventType = 'tweet.new' | 'tweet.reply' | 'tweet.retweet' | 'tweet.quote'
|
|
10
|
+
export type EventType = 'tweet.new' | 'tweet.reply' | 'tweet.retweet' | 'tweet.quote';
|
|
13
11
|
/**
|
|
14
12
|
* Paginated list of tweets with cursor-based navigation.
|
|
15
13
|
*/
|
|
16
14
|
export interface PaginatedTweets {
|
|
17
15
|
has_next_page: boolean;
|
|
18
16
|
next_cursor: string;
|
|
19
|
-
tweets: Array<
|
|
17
|
+
tweets: Array<SearchTweet>;
|
|
20
18
|
}
|
|
21
19
|
/**
|
|
22
20
|
* Paginated list of user profiles with cursor-based navigation.
|
|
@@ -24,6 +22,49 @@ export interface PaginatedTweets {
|
|
|
24
22
|
export interface PaginatedUsers {
|
|
25
23
|
has_next_page: boolean;
|
|
26
24
|
next_cursor: string;
|
|
27
|
-
users: Array<
|
|
25
|
+
users: Array<UserProfile>;
|
|
26
|
+
}
|
|
27
|
+
/**
|
|
28
|
+
* Tweet returned from search results with inline author info.
|
|
29
|
+
*/
|
|
30
|
+
export interface SearchTweet {
|
|
31
|
+
id: string;
|
|
32
|
+
text: string;
|
|
33
|
+
author?: SearchTweet.Author;
|
|
34
|
+
bookmarkCount?: number;
|
|
35
|
+
createdAt?: string;
|
|
36
|
+
/**
|
|
37
|
+
* True for Note Tweets (long-form content, up to 25,000 characters)
|
|
38
|
+
*/
|
|
39
|
+
isNoteTweet?: boolean;
|
|
40
|
+
likeCount?: number;
|
|
41
|
+
quoteCount?: number;
|
|
42
|
+
replyCount?: number;
|
|
43
|
+
retweetCount?: number;
|
|
44
|
+
viewCount?: number;
|
|
45
|
+
}
|
|
46
|
+
export declare namespace SearchTweet {
|
|
47
|
+
interface Author {
|
|
48
|
+
id: string;
|
|
49
|
+
name: string;
|
|
50
|
+
username: string;
|
|
51
|
+
verified?: boolean;
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
/**
|
|
55
|
+
* X user profile with bio, follower counts, and verification status.
|
|
56
|
+
*/
|
|
57
|
+
export interface UserProfile {
|
|
58
|
+
id: string;
|
|
59
|
+
name: string;
|
|
60
|
+
username: string;
|
|
61
|
+
createdAt?: string;
|
|
62
|
+
description?: string;
|
|
63
|
+
followers?: number;
|
|
64
|
+
following?: number;
|
|
65
|
+
location?: string;
|
|
66
|
+
profilePicture?: string;
|
|
67
|
+
statusesCount?: number;
|
|
68
|
+
verified?: boolean;
|
|
28
69
|
}
|
|
29
70
|
//# sourceMappingURL=shared.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../src/resources/shared.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"shared.d.ts","sourceRoot":"","sources":["../src/resources/shared.ts"],"names":[],"mappings":"AAEA;;GAEG;AACH,MAAM,WAAW,KAAK;IACpB,KAAK,EACD,gBAAgB,GAChB,gBAAgB,GAChB,YAAY,GACZ,eAAe,GACf,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,mB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,EAAE,MAAM,CAAC;QAEjB,QAAQ,CAAC,EAAE,OAAO,CAAC;KACpB;CACF;AAED;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,EAAE,EAAE,MAAM,CAAC;IAEX,IAAI,EAAE,MAAM,CAAC;IAEb,QAAQ,EAAE,MAAM,CAAC;IAEjB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,SAAS,CAAC,EAAE,MAAM,CAAC;IAEnB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB,cAAc,CAAC,EAAE,MAAM,CAAC;IAExB,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB"}
|
package/resources/styles.d.mts
CHANGED
|
@@ -2,7 +2,7 @@ import { APIResource } from "../core/resource.mjs";
|
|
|
2
2
|
import { APIPromise } from "../core/api-promise.mjs";
|
|
3
3
|
import { RequestOptions } from "../internal/request-options.mjs";
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* AI tweet composition, drafts, writing styles, and radar
|
|
6
6
|
*/
|
|
7
7
|
export declare class Styles extends APIResource {
|
|
8
8
|
/**
|
package/resources/styles.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { APIResource } from "../core/resource.js";
|
|
|
2
2
|
import { APIPromise } from "../core/api-promise.js";
|
|
3
3
|
import { RequestOptions } from "../internal/request-options.js";
|
|
4
4
|
/**
|
|
5
|
-
*
|
|
5
|
+
* AI tweet composition, drafts, writing styles, and radar
|
|
6
6
|
*/
|
|
7
7
|
export declare class Styles extends APIResource {
|
|
8
8
|
/**
|
package/resources/styles.js
CHANGED
|
@@ -6,7 +6,7 @@ const resource_1 = require("../core/resource.js");
|
|
|
6
6
|
const headers_1 = require("../internal/headers.js");
|
|
7
7
|
const path_1 = require("../internal/utils/path.js");
|
|
8
8
|
/**
|
|
9
|
-
*
|
|
9
|
+
* AI tweet composition, drafts, writing styles, and radar
|
|
10
10
|
*/
|
|
11
11
|
class Styles extends resource_1.APIResource {
|
|
12
12
|
/**
|
package/resources/styles.mjs
CHANGED
|
@@ -3,7 +3,7 @@ import { APIResource } from "../core/resource.mjs";
|
|
|
3
3
|
import { buildHeaders } from "../internal/headers.mjs";
|
|
4
4
|
import { path } from "../internal/utils/path.mjs";
|
|
5
5
|
/**
|
|
6
|
-
*
|
|
6
|
+
* AI tweet composition, drafts, writing styles, and radar
|
|
7
7
|
*/
|
|
8
8
|
export class Styles extends APIResource {
|
|
9
9
|
/**
|
|
@@ -2,7 +2,7 @@ import { APIResource } from "../core/resource.mjs";
|
|
|
2
2
|
import { APIPromise } from "../core/api-promise.mjs";
|
|
3
3
|
import { RequestOptions } from "../internal/request-options.mjs";
|
|
4
4
|
/**
|
|
5
|
-
* Subscription
|
|
5
|
+
* Subscription, billing, and credits
|
|
6
6
|
*/
|
|
7
7
|
export declare class Subscribe extends APIResource {
|
|
8
8
|
/**
|
package/resources/subscribe.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { APIResource } from "../core/resource.js";
|
|
|
2
2
|
import { APIPromise } from "../core/api-promise.js";
|
|
3
3
|
import { RequestOptions } from "../internal/request-options.js";
|
|
4
4
|
/**
|
|
5
|
-
* Subscription
|
|
5
|
+
* Subscription, billing, and credits
|
|
6
6
|
*/
|
|
7
7
|
export declare class Subscribe extends APIResource {
|
|
8
8
|
/**
|
package/resources/subscribe.js
CHANGED
|
@@ -4,7 +4,7 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
exports.Subscribe = void 0;
|
|
5
5
|
const resource_1 = require("../core/resource.js");
|
|
6
6
|
/**
|
|
7
|
-
* Subscription
|
|
7
|
+
* Subscription, billing, and credits
|
|
8
8
|
*/
|
|
9
9
|
class Subscribe extends resource_1.APIResource {
|
|
10
10
|
/**
|
package/resources/subscribe.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
import { APIResource } from "../core/resource.mjs";
|
|
3
3
|
/**
|
|
4
|
-
* Subscription
|
|
4
|
+
* Subscription, billing, and credits
|
|
5
5
|
*/
|
|
6
6
|
export class Subscribe extends APIResource {
|
|
7
7
|
/**
|
package/resources/trends.d.mts
CHANGED
|
@@ -2,11 +2,11 @@ import { APIResource } from "../core/resource.mjs";
|
|
|
2
2
|
import { APIPromise } from "../core/api-promise.mjs";
|
|
3
3
|
import { RequestOptions } from "../internal/request-options.mjs";
|
|
4
4
|
/**
|
|
5
|
-
* Trending topics by region
|
|
5
|
+
* Trending topics and hashtags by region
|
|
6
6
|
*/
|
|
7
7
|
export declare class Trends extends APIResource {
|
|
8
8
|
/**
|
|
9
|
-
* Get
|
|
9
|
+
* Get trending hashtags and topics by region (alias)
|
|
10
10
|
*/
|
|
11
11
|
list(query?: TrendListParams | null | undefined, options?: RequestOptions): APIPromise<TrendListResponse>;
|
|
12
12
|
}
|
package/resources/trends.d.ts
CHANGED
|
@@ -2,11 +2,11 @@ import { APIResource } from "../core/resource.js";
|
|
|
2
2
|
import { APIPromise } from "../core/api-promise.js";
|
|
3
3
|
import { RequestOptions } from "../internal/request-options.js";
|
|
4
4
|
/**
|
|
5
|
-
* Trending topics by region
|
|
5
|
+
* Trending topics and hashtags by region
|
|
6
6
|
*/
|
|
7
7
|
export declare class Trends extends APIResource {
|
|
8
8
|
/**
|
|
9
|
-
* Get
|
|
9
|
+
* Get trending hashtags and topics by region (alias)
|
|
10
10
|
*/
|
|
11
11
|
list(query?: TrendListParams | null | undefined, options?: RequestOptions): APIPromise<TrendListResponse>;
|
|
12
12
|
}
|
package/resources/trends.js
CHANGED
|
@@ -4,11 +4,11 @@ Object.defineProperty(exports, "__esModule", { value: true });
|
|
|
4
4
|
exports.Trends = void 0;
|
|
5
5
|
const resource_1 = require("../core/resource.js");
|
|
6
6
|
/**
|
|
7
|
-
* Trending topics by region
|
|
7
|
+
* Trending topics and hashtags by region
|
|
8
8
|
*/
|
|
9
9
|
class Trends extends resource_1.APIResource {
|
|
10
10
|
/**
|
|
11
|
-
* Get
|
|
11
|
+
* Get trending hashtags and topics by region (alias)
|
|
12
12
|
*/
|
|
13
13
|
list(query = {}, options) {
|
|
14
14
|
return this._client.get('/trends', { query, ...options });
|
package/resources/trends.mjs
CHANGED
|
@@ -1,11 +1,11 @@
|
|
|
1
1
|
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
2
|
import { APIResource } from "../core/resource.mjs";
|
|
3
3
|
/**
|
|
4
|
-
* Trending topics by region
|
|
4
|
+
* Trending topics and hashtags by region
|
|
5
5
|
*/
|
|
6
6
|
export class Trends extends APIResource {
|
|
7
7
|
/**
|
|
8
|
-
* Get
|
|
8
|
+
* Get trending hashtags and topics by region (alias)
|
|
9
9
|
*/
|
|
10
10
|
list(query = {}, options) {
|
|
11
11
|
return this._client.get('/trends', { query, ...options });
|
package/resources/webhooks.d.mts
CHANGED
|
@@ -3,7 +3,7 @@ import * as Shared from "./shared.mjs";
|
|
|
3
3
|
import { APIPromise } from "../core/api-promise.mjs";
|
|
4
4
|
import { RequestOptions } from "../internal/request-options.mjs";
|
|
5
5
|
/**
|
|
6
|
-
* Webhook endpoint management
|
|
6
|
+
* Webhook endpoint management and delivery
|
|
7
7
|
*/
|
|
8
8
|
export declare class Webhooks extends APIResource {
|
|
9
9
|
/**
|
|
@@ -12,7 +12,7 @@ export declare class Webhooks extends APIResource {
|
|
|
12
12
|
* @example
|
|
13
13
|
* ```ts
|
|
14
14
|
* const webhook = await client.webhooks.create({
|
|
15
|
-
* eventTypes: ['tweet.new', '
|
|
15
|
+
* eventTypes: ['tweet.new', 'tweet.reply'],
|
|
16
16
|
* url: 'https://example.com/webhook',
|
|
17
17
|
* });
|
|
18
18
|
* ```
|
package/resources/webhooks.d.ts
CHANGED
|
@@ -3,7 +3,7 @@ import * as Shared from "./shared.js";
|
|
|
3
3
|
import { APIPromise } from "../core/api-promise.js";
|
|
4
4
|
import { RequestOptions } from "../internal/request-options.js";
|
|
5
5
|
/**
|
|
6
|
-
* Webhook endpoint management
|
|
6
|
+
* Webhook endpoint management and delivery
|
|
7
7
|
*/
|
|
8
8
|
export declare class Webhooks extends APIResource {
|
|
9
9
|
/**
|
|
@@ -12,7 +12,7 @@ export declare class Webhooks extends APIResource {
|
|
|
12
12
|
* @example
|
|
13
13
|
* ```ts
|
|
14
14
|
* const webhook = await client.webhooks.create({
|
|
15
|
-
* eventTypes: ['tweet.new', '
|
|
15
|
+
* eventTypes: ['tweet.new', 'tweet.reply'],
|
|
16
16
|
* url: 'https://example.com/webhook',
|
|
17
17
|
* });
|
|
18
18
|
* ```
|
package/resources/webhooks.js
CHANGED
|
@@ -5,7 +5,7 @@ exports.Webhooks = void 0;
|
|
|
5
5
|
const resource_1 = require("../core/resource.js");
|
|
6
6
|
const path_1 = require("../internal/utils/path.js");
|
|
7
7
|
/**
|
|
8
|
-
* Webhook endpoint management
|
|
8
|
+
* Webhook endpoint management and delivery
|
|
9
9
|
*/
|
|
10
10
|
class Webhooks extends resource_1.APIResource {
|
|
11
11
|
/**
|
|
@@ -14,7 +14,7 @@ class Webhooks extends resource_1.APIResource {
|
|
|
14
14
|
* @example
|
|
15
15
|
* ```ts
|
|
16
16
|
* const webhook = await client.webhooks.create({
|
|
17
|
-
* eventTypes: ['tweet.new', '
|
|
17
|
+
* eventTypes: ['tweet.new', 'tweet.reply'],
|
|
18
18
|
* url: 'https://example.com/webhook',
|
|
19
19
|
* });
|
|
20
20
|
* ```
|
package/resources/webhooks.mjs
CHANGED
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
import { APIResource } from "../core/resource.mjs";
|
|
3
3
|
import { path } from "../internal/utils/path.mjs";
|
|
4
4
|
/**
|
|
5
|
-
* Webhook endpoint management
|
|
5
|
+
* Webhook endpoint management and delivery
|
|
6
6
|
*/
|
|
7
7
|
export class Webhooks extends APIResource {
|
|
8
8
|
/**
|
|
@@ -11,7 +11,7 @@ export class Webhooks extends APIResource {
|
|
|
11
11
|
* @example
|
|
12
12
|
* ```ts
|
|
13
13
|
* const webhook = await client.webhooks.create({
|
|
14
|
-
* eventTypes: ['tweet.new', '
|
|
14
|
+
* eventTypes: ['tweet.new', 'tweet.reply'],
|
|
15
15
|
* url: 'https://example.com/webhook',
|
|
16
16
|
* });
|
|
17
17
|
* ```
|
|
@@ -76,6 +76,14 @@ export declare class Accounts extends APIResource {
|
|
|
76
76
|
export interface XAccount {
|
|
77
77
|
id: string;
|
|
78
78
|
createdAt: string;
|
|
79
|
+
/**
|
|
80
|
+
* Derived login/cookie health. `healthy` = cookies valid. `needsReauth` = user
|
|
81
|
+
* must submit fresh credentials. `locked` = X locked the account; unlock on x.com
|
|
82
|
+
* first. `suspended` = X banned the account. `recovering` = past cooldown, will
|
|
83
|
+
* auto-retry on next use. `temporaryIssue` = transient backend problem; retry
|
|
84
|
+
* shortly.
|
|
85
|
+
*/
|
|
86
|
+
health: 'healthy' | 'locked' | 'needsReauth' | 'recovering' | 'suspended' | 'temporaryIssue';
|
|
79
87
|
status: string;
|
|
80
88
|
xUserId: string;
|
|
81
89
|
xUsername: string;
|
|
@@ -86,6 +94,7 @@ export interface XAccount {
|
|
|
86
94
|
export interface XAccountDetail {
|
|
87
95
|
id: string;
|
|
88
96
|
createdAt: string;
|
|
97
|
+
health: 'healthy' | 'locked' | 'needsReauth' | 'recovering' | 'suspended' | 'temporaryIssue';
|
|
89
98
|
status: string;
|
|
90
99
|
xUserId: string;
|
|
91
100
|
xUsername: string;
|
|
@@ -93,11 +102,26 @@ export interface XAccountDetail {
|
|
|
93
102
|
proxyCountry?: string;
|
|
94
103
|
updatedAt?: string;
|
|
95
104
|
}
|
|
105
|
+
/**
|
|
106
|
+
* Sanitized X account summary returned by connect and reauth. Includes an optional
|
|
107
|
+
* `loginCountry` field surfaced only when the declared proxy region had no Driver
|
|
108
|
+
* capacity and the login fell back to a single US consumer device for this
|
|
109
|
+
* one-time action. Future activity continues to use the selected `proxy_country`;
|
|
110
|
+
* the field is omitted on normal logins.
|
|
111
|
+
*/
|
|
96
112
|
export interface AccountCreateResponse {
|
|
97
113
|
id: string;
|
|
114
|
+
createdAt: string;
|
|
115
|
+
health: 'healthy' | 'locked' | 'needsReauth' | 'recovering' | 'suspended' | 'temporaryIssue';
|
|
98
116
|
status: string;
|
|
99
117
|
xUserId: string;
|
|
100
118
|
xUsername: string;
|
|
119
|
+
/**
|
|
120
|
+
* ISO-3166-1 alpha-2 country code of the Driver consumer device used for this
|
|
121
|
+
* login. Present only when the US fallback was triggered because Driver had no
|
|
122
|
+
* capacity in the declared region. Omitted otherwise.
|
|
123
|
+
*/
|
|
124
|
+
loginCountry?: string;
|
|
101
125
|
}
|
|
102
126
|
export interface AccountListResponse {
|
|
103
127
|
accounts: Array<XAccount>;
|
|
@@ -111,10 +135,26 @@ export interface AccountBulkRetryResponse {
|
|
|
111
135
|
*/
|
|
112
136
|
cleared: number;
|
|
113
137
|
}
|
|
138
|
+
/**
|
|
139
|
+
* Sanitized X account summary returned by connect and reauth. Includes an optional
|
|
140
|
+
* `loginCountry` field surfaced only when the declared proxy region had no Driver
|
|
141
|
+
* capacity and the login fell back to a single US consumer device for this
|
|
142
|
+
* one-time action. Future activity continues to use the selected `proxy_country`;
|
|
143
|
+
* the field is omitted on normal logins.
|
|
144
|
+
*/
|
|
114
145
|
export interface AccountReauthResponse {
|
|
115
146
|
id: string;
|
|
147
|
+
createdAt: string;
|
|
148
|
+
health: 'healthy' | 'locked' | 'needsReauth' | 'recovering' | 'suspended' | 'temporaryIssue';
|
|
116
149
|
status: string;
|
|
150
|
+
xUserId: string;
|
|
117
151
|
xUsername: string;
|
|
152
|
+
/**
|
|
153
|
+
* ISO-3166-1 alpha-2 country code of the Driver consumer device used for this
|
|
154
|
+
* login. Present only when the US fallback was triggered because Driver had no
|
|
155
|
+
* capacity in the declared region. Omitted otherwise.
|
|
156
|
+
*/
|
|
157
|
+
loginCountry?: string;
|
|
118
158
|
}
|
|
119
159
|
export interface AccountCreateParams {
|
|
120
160
|
/**
|
|
@@ -143,6 +183,14 @@ export interface AccountReauthParams {
|
|
|
143
183
|
* Updated account password
|
|
144
184
|
*/
|
|
145
185
|
password: string;
|
|
186
|
+
/**
|
|
187
|
+
* Email for the X account (updates stored email)
|
|
188
|
+
*/
|
|
189
|
+
email?: string;
|
|
190
|
+
/**
|
|
191
|
+
* Two-letter country code for login proxy region
|
|
192
|
+
*/
|
|
193
|
+
proxy_country?: string;
|
|
146
194
|
/**
|
|
147
195
|
* TOTP secret for 2FA re-authentication
|
|
148
196
|
*/
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"accounts.d.mts","sourceRoot":"","sources":["../../src/resources/x/accounts.ts"],"names":[],"mappings":"OAEO,EAAE,WAAW,EAAE;OACf,EAAE,UAAU,EAAE;OACd,EAAE,cAAc,EAAE;AAGzB;;GAEG;AACH,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,IAAI,EAAE,mBAAmB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,qBAAqB,CAAC;IAI9F;;;;;;;;;OASG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,cAAc,CAAC;IAI1E;;;;;;;OAOG;IACH,IAAI,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,mBAAmB,CAAC;IAI/D;;;;;;;OAOG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,qBAAqB,CAAC;IAI/E;;;;;;;;OAQG;IACH,SAAS,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,wBAAwB,CAAC;IAIzE;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAE,EAAE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