x-twitter-scraper 0.17.0 → 0.19.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 +35 -0
- package/client.d.mts +7 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +7 -0
- package/client.d.ts.map +1 -1
- package/client.js +6 -0
- package/client.js.map +1 -1
- package/client.mjs +6 -0
- package/client.mjs.map +1 -1
- package/package.json +3 -3
- package/resources/account.d.mts +1 -1
- package/resources/account.d.mts.map +1 -1
- package/resources/account.d.ts +1 -1
- package/resources/account.d.ts.map +1 -1
- package/resources/activity.d.mts +214 -0
- package/resources/activity.d.mts.map +1 -0
- package/resources/activity.d.ts +214 -0
- package/resources/activity.d.ts.map +1 -0
- package/resources/activity.js +67 -0
- package/resources/activity.js.map +1 -0
- package/resources/activity.mjs +63 -0
- package/resources/activity.mjs.map +1 -0
- package/resources/credits.d.mts +24 -0
- package/resources/credits.d.mts.map +1 -1
- package/resources/credits.d.ts +24 -0
- package/resources/credits.d.ts.map +1 -1
- package/resources/credits.js.map +1 -1
- package/resources/credits.mjs.map +1 -1
- package/resources/events.d.mts +69 -0
- package/resources/events.d.mts.map +1 -1
- package/resources/events.d.ts +69 -0
- package/resources/events.d.ts.map +1 -1
- package/resources/events.js +2 -1
- package/resources/events.js.map +1 -1
- package/resources/events.mjs +2 -1
- package/resources/events.mjs.map +1 -1
- package/resources/extractions.d.mts +8 -0
- package/resources/extractions.d.mts.map +1 -1
- package/resources/extractions.d.ts +8 -0
- package/resources/extractions.d.ts.map +1 -1
- package/resources/index.d.mts +1 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/monitors/posts.d.mts +45 -1
- package/resources/monitors/posts.d.mts.map +1 -1
- package/resources/monitors/posts.d.ts +45 -1
- package/resources/monitors/posts.d.ts.map +1 -1
- package/resources/monitors/posts.js +1 -1
- package/resources/monitors/posts.mjs +1 -1
- package/resources/shared.d.mts +67 -1
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +67 -1
- package/resources/shared.d.ts.map +1 -1
- package/resources/subscribe.d.mts +11 -0
- package/resources/subscribe.d.mts.map +1 -1
- package/resources/subscribe.d.ts +11 -0
- package/resources/subscribe.d.ts.map +1 -1
- package/resources/subscribe.js.map +1 -1
- package/resources/subscribe.mjs.map +1 -1
- package/resources/x/index.d.mts +1 -1
- package/resources/x/index.d.mts.map +1 -1
- package/resources/x/index.d.ts +1 -1
- 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/media.d.mts +36 -0
- package/resources/x/media.d.mts.map +1 -1
- package/resources/x/media.d.ts +36 -0
- package/resources/x/media.d.ts.map +1 -1
- package/resources/x/sports.d.mts +474 -4
- package/resources/x/sports.d.mts.map +1 -1
- package/resources/x/sports.d.ts +474 -4
- package/resources/x/sports.d.ts.map +1 -1
- package/resources/x/sports.js +64 -1
- package/resources/x/sports.js.map +1 -1
- package/resources/x/sports.mjs +64 -1
- package/resources/x/sports.mjs.map +1 -1
- package/resources/x/tweets/tweets.d.mts +31 -0
- package/resources/x/tweets/tweets.d.mts.map +1 -1
- package/resources/x/tweets/tweets.d.ts +31 -0
- package/resources/x/tweets/tweets.d.ts.map +1 -1
- package/resources/x/tweets/tweets.js.map +1 -1
- package/resources/x/tweets/tweets.mjs.map +1 -1
- package/resources/x/x.d.mts +2 -2
- package/resources/x/x.d.mts.map +1 -1
- package/resources/x/x.d.ts +2 -2
- package/resources/x/x.d.ts.map +1 -1
- package/resources/x/x.js.map +1 -1
- package/resources/x/x.mjs.map +1 -1
- package/skills/x-twitter-scraper/references/api-endpoints-draws.md +13 -13
- package/skills/x-twitter-scraper/references/draws.md +3 -3
- package/skills/x-twitter-scraper/references/python-examples.md +2 -2
- package/src/client.ts +23 -0
- package/src/resources/account.ts +1 -1
- package/src/resources/activity.ts +302 -0
- package/src/resources/credits.ts +29 -0
- package/src/resources/events.ts +85 -1
- package/src/resources/extractions.ts +9 -0
- package/src/resources/index.ts +8 -0
- package/src/resources/monitors/posts.ts +58 -1
- package/src/resources/shared.ts +113 -0
- package/src/resources/subscribe.ts +13 -0
- package/src/resources/x/index.ts +18 -0
- package/src/resources/x/media.ts +50 -0
- package/src/resources/x/sports.ts +583 -3
- package/src/resources/x/tweets/tweets.ts +35 -0
- package/src/resources/x/x.ts +36 -0
- 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
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import { APIResource } from "../core/resource.mjs";
|
|
2
|
+
import { APIPromise } from "../core/api-promise.mjs";
|
|
3
|
+
import { RequestOptions } from "../internal/request-options.mjs";
|
|
4
|
+
/**
|
|
5
|
+
* Account activity log
|
|
6
|
+
*/
|
|
7
|
+
export declare class Activity extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Returns the account's activity log, newest first, with the Activity page's
|
|
10
|
+
* filters. It covers write actions, extractions, monitor changes and events,
|
|
11
|
+
* webhooks, giveaways, media, support, API keys, X account connections and
|
|
12
|
+
* billing.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const rows = await client.activity.list({
|
|
17
|
+
* category: 'monitors',
|
|
18
|
+
* limit: 50,
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
list(query?: ActivityListParams | null | undefined, options?: RequestOptions): APIPromise<ActivityListResponse>;
|
|
23
|
+
/**
|
|
24
|
+
* Returns 1 activity of the account with its full technical record. It covers
|
|
25
|
+
* write actions, extractions and monitor changes. The record holds the request,
|
|
26
|
+
* the caller, the charge, every timestamp in UTC and related activity. It never
|
|
27
|
+
* holds an API key value or another account's data.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* const activityRecord = await client.activity.retrieve('naF3xqHLWDTs');
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<ActivityRecord>;
|
|
35
|
+
/**
|
|
36
|
+
* Downloads the activity log rows as a CSV, Excel, JSON, Markdown, PDF or text
|
|
37
|
+
* file, with the same filters as list.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* const response = await client.activity.export({ format: 'csv' });
|
|
42
|
+
*
|
|
43
|
+
* const content = await response.blob();
|
|
44
|
+
* console.log(content);
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export(query: ActivityExportParams, options?: RequestOptions): APIPromise<Response>;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* 1 Activity log row. A cut list ends with a row whose category is notice and
|
|
51
|
+
* whose activity says where it stopped.
|
|
52
|
+
*/
|
|
53
|
+
export interface ActivityLogRow {
|
|
54
|
+
/**
|
|
55
|
+
* Activity ID.
|
|
56
|
+
*/
|
|
57
|
+
id: string;
|
|
58
|
+
activity: string;
|
|
59
|
+
category: string;
|
|
60
|
+
/**
|
|
61
|
+
* Credits, or an empty string when the activity has none.
|
|
62
|
+
*/
|
|
63
|
+
credits: number | string;
|
|
64
|
+
details: string;
|
|
65
|
+
link: string;
|
|
66
|
+
/**
|
|
67
|
+
* Result count, or an empty string when the activity has none.
|
|
68
|
+
*/
|
|
69
|
+
results: number | string;
|
|
70
|
+
source: string;
|
|
71
|
+
status: string;
|
|
72
|
+
target: string;
|
|
73
|
+
/**
|
|
74
|
+
* ISO 8601 time in UTC to the millisecond. Empty on the notice row.
|
|
75
|
+
*/
|
|
76
|
+
time: string;
|
|
77
|
+
type: string;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Full technical record of 1 activity. Timestamps are ISO 8601 in UTC to the
|
|
81
|
+
* millisecond.
|
|
82
|
+
*/
|
|
83
|
+
export interface ActivityRecord {
|
|
84
|
+
/**
|
|
85
|
+
* Activity ID.
|
|
86
|
+
*/
|
|
87
|
+
id: string;
|
|
88
|
+
caller: ActivityRecord.Caller;
|
|
89
|
+
/**
|
|
90
|
+
* Credits charged for this activity.
|
|
91
|
+
*/
|
|
92
|
+
charge: ActivityRecord.Charge | null;
|
|
93
|
+
/**
|
|
94
|
+
* Fields of this kind of activity, such as its target.
|
|
95
|
+
*/
|
|
96
|
+
details: {
|
|
97
|
+
[key: string]: string | number | boolean | null;
|
|
98
|
+
};
|
|
99
|
+
kind: 'write_action' | 'extraction' | 'monitor_change';
|
|
100
|
+
object: 'activity';
|
|
101
|
+
/**
|
|
102
|
+
* Up to 5 other activities on the same subject within 7 days, newest first.
|
|
103
|
+
*/
|
|
104
|
+
related: Array<ActivityRecord.Related>;
|
|
105
|
+
/**
|
|
106
|
+
* The API request behind this activity. Null for activity from before Oct 30,
|
|
107
|
+
* 2026.
|
|
108
|
+
*/
|
|
109
|
+
request: ActivityRecord.Request | null;
|
|
110
|
+
/**
|
|
111
|
+
* ID of the API request behind this activity.
|
|
112
|
+
*/
|
|
113
|
+
requestId: string | null;
|
|
114
|
+
status: 'completed' | 'running' | 'failed' | 'canceled';
|
|
115
|
+
timestamps: ActivityRecord.Timestamps;
|
|
116
|
+
/**
|
|
117
|
+
* Write action type, extraction tool type or monitor change.
|
|
118
|
+
*/
|
|
119
|
+
type: string;
|
|
120
|
+
/**
|
|
121
|
+
* Dashboard page of this activity.
|
|
122
|
+
*/
|
|
123
|
+
url: string;
|
|
124
|
+
}
|
|
125
|
+
export declare namespace ActivityRecord {
|
|
126
|
+
interface Caller {
|
|
127
|
+
/**
|
|
128
|
+
* Name and prefix of the API key used. Never its value.
|
|
129
|
+
*/
|
|
130
|
+
apiKey: Caller.APIKey | null;
|
|
131
|
+
authMethod: 'api_key' | 'oauth' | 'session' | null;
|
|
132
|
+
oauthClient: Caller.OAuthClient | null;
|
|
133
|
+
}
|
|
134
|
+
namespace Caller {
|
|
135
|
+
interface APIKey {
|
|
136
|
+
name: string;
|
|
137
|
+
prefix: string;
|
|
138
|
+
}
|
|
139
|
+
interface OAuthClient {
|
|
140
|
+
id: string;
|
|
141
|
+
name: string;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
interface Charge {
|
|
145
|
+
at: string;
|
|
146
|
+
balanceAfter: number;
|
|
147
|
+
credits: number;
|
|
148
|
+
}
|
|
149
|
+
interface Related {
|
|
150
|
+
id: string;
|
|
151
|
+
createdAt: string;
|
|
152
|
+
status: 'completed' | 'running' | 'failed' | 'canceled';
|
|
153
|
+
type: string;
|
|
154
|
+
url: string;
|
|
155
|
+
}
|
|
156
|
+
interface Request {
|
|
157
|
+
at: string;
|
|
158
|
+
durationMs: number;
|
|
159
|
+
httpStatus: number;
|
|
160
|
+
ipAddress: string | null;
|
|
161
|
+
method: 'DELETE' | 'PATCH' | 'POST' | 'PUT';
|
|
162
|
+
path: string;
|
|
163
|
+
userAgent: string | null;
|
|
164
|
+
}
|
|
165
|
+
interface Timestamps {
|
|
166
|
+
createdAt: string;
|
|
167
|
+
completedAt?: string;
|
|
168
|
+
confirmedAt?: string;
|
|
169
|
+
expiresAt?: string;
|
|
170
|
+
updatedAt?: string;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
export type ActivityListResponse = Array<ActivityLogRow>;
|
|
174
|
+
export interface ActivityListParams {
|
|
175
|
+
/**
|
|
176
|
+
* Activity group, like the Activity page's tabs. `all` by default, or `actions`,
|
|
177
|
+
* `extractions`, `monitors`, `webhooks` or `billing`.
|
|
178
|
+
*/
|
|
179
|
+
category?: string;
|
|
180
|
+
/**
|
|
181
|
+
* Leave it out or pass json to get the rows. Use export for a file.
|
|
182
|
+
*/
|
|
183
|
+
format?: 'json';
|
|
184
|
+
/**
|
|
185
|
+
* Most rows to return, from 1 to 100,000. 100 by default.
|
|
186
|
+
*/
|
|
187
|
+
limit?: number;
|
|
188
|
+
/**
|
|
189
|
+
* Search text.
|
|
190
|
+
*/
|
|
191
|
+
q?: string;
|
|
192
|
+
/**
|
|
193
|
+
* Oldest time, ISO 8601.
|
|
194
|
+
*/
|
|
195
|
+
since?: string;
|
|
196
|
+
/**
|
|
197
|
+
* Comma-separated statuses.
|
|
198
|
+
*/
|
|
199
|
+
status?: string;
|
|
200
|
+
/**
|
|
201
|
+
* Newest time, ISO 8601.
|
|
202
|
+
*/
|
|
203
|
+
until?: string;
|
|
204
|
+
}
|
|
205
|
+
export interface ActivityExportParams extends Omit<ActivityListParams, 'format'> {
|
|
206
|
+
/**
|
|
207
|
+
* File format. PDF stops at 10,000 rows.
|
|
208
|
+
*/
|
|
209
|
+
format: 'csv' | 'json' | 'md' | 'md-document' | 'pdf' | 'txt' | 'xlsx';
|
|
210
|
+
}
|
|
211
|
+
export declare namespace Activity {
|
|
212
|
+
export { type ActivityLogRow as ActivityLogRow, type ActivityRecord as ActivityRecord, type ActivityListResponse as ActivityListResponse, type ActivityListParams as ActivityListParams, type ActivityExportParams as ActivityExportParams, };
|
|
213
|
+
}
|
|
214
|
+
//# sourceMappingURL=activity.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activity.d.mts","sourceRoot":"","sources":["../src/resources/activity.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,gCAA4B;AAEjD,OAAO,EAAE,cAAc,EAAE,wCAAoC;AAG7D;;GAEG;AACH,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;OAaG;IACH,IAAI,CACF,KAAK,GAAE,kBAAkB,GAAG,IAAI,GAAG,SAAc,EACjD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,oBAAoB,CAAC,CAElC;IAED;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM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
+
import { APIPromise } from "../core/api-promise.js";
|
|
3
|
+
import { RequestOptions } from "../internal/request-options.js";
|
|
4
|
+
/**
|
|
5
|
+
* Account activity log
|
|
6
|
+
*/
|
|
7
|
+
export declare class Activity extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Returns the account's activity log, newest first, with the Activity page's
|
|
10
|
+
* filters. It covers write actions, extractions, monitor changes and events,
|
|
11
|
+
* webhooks, giveaways, media, support, API keys, X account connections and
|
|
12
|
+
* billing.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const rows = await client.activity.list({
|
|
17
|
+
* category: 'monitors',
|
|
18
|
+
* limit: 50,
|
|
19
|
+
* });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
list(query?: ActivityListParams | null | undefined, options?: RequestOptions): APIPromise<ActivityListResponse>;
|
|
23
|
+
/**
|
|
24
|
+
* Returns 1 activity of the account with its full technical record. It covers
|
|
25
|
+
* write actions, extractions and monitor changes. The record holds the request,
|
|
26
|
+
* the caller, the charge, every timestamp in UTC and related activity. It never
|
|
27
|
+
* holds an API key value or another account's data.
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* ```ts
|
|
31
|
+
* const activityRecord = await client.activity.retrieve('naF3xqHLWDTs');
|
|
32
|
+
* ```
|
|
33
|
+
*/
|
|
34
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<ActivityRecord>;
|
|
35
|
+
/**
|
|
36
|
+
* Downloads the activity log rows as a CSV, Excel, JSON, Markdown, PDF or text
|
|
37
|
+
* file, with the same filters as list.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* const response = await client.activity.export({ format: 'csv' });
|
|
42
|
+
*
|
|
43
|
+
* const content = await response.blob();
|
|
44
|
+
* console.log(content);
|
|
45
|
+
* ```
|
|
46
|
+
*/
|
|
47
|
+
export(query: ActivityExportParams, options?: RequestOptions): APIPromise<Response>;
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* 1 Activity log row. A cut list ends with a row whose category is notice and
|
|
51
|
+
* whose activity says where it stopped.
|
|
52
|
+
*/
|
|
53
|
+
export interface ActivityLogRow {
|
|
54
|
+
/**
|
|
55
|
+
* Activity ID.
|
|
56
|
+
*/
|
|
57
|
+
id: string;
|
|
58
|
+
activity: string;
|
|
59
|
+
category: string;
|
|
60
|
+
/**
|
|
61
|
+
* Credits, or an empty string when the activity has none.
|
|
62
|
+
*/
|
|
63
|
+
credits: number | string;
|
|
64
|
+
details: string;
|
|
65
|
+
link: string;
|
|
66
|
+
/**
|
|
67
|
+
* Result count, or an empty string when the activity has none.
|
|
68
|
+
*/
|
|
69
|
+
results: number | string;
|
|
70
|
+
source: string;
|
|
71
|
+
status: string;
|
|
72
|
+
target: string;
|
|
73
|
+
/**
|
|
74
|
+
* ISO 8601 time in UTC to the millisecond. Empty on the notice row.
|
|
75
|
+
*/
|
|
76
|
+
time: string;
|
|
77
|
+
type: string;
|
|
78
|
+
}
|
|
79
|
+
/**
|
|
80
|
+
* Full technical record of 1 activity. Timestamps are ISO 8601 in UTC to the
|
|
81
|
+
* millisecond.
|
|
82
|
+
*/
|
|
83
|
+
export interface ActivityRecord {
|
|
84
|
+
/**
|
|
85
|
+
* Activity ID.
|
|
86
|
+
*/
|
|
87
|
+
id: string;
|
|
88
|
+
caller: ActivityRecord.Caller;
|
|
89
|
+
/**
|
|
90
|
+
* Credits charged for this activity.
|
|
91
|
+
*/
|
|
92
|
+
charge: ActivityRecord.Charge | null;
|
|
93
|
+
/**
|
|
94
|
+
* Fields of this kind of activity, such as its target.
|
|
95
|
+
*/
|
|
96
|
+
details: {
|
|
97
|
+
[key: string]: string | number | boolean | null;
|
|
98
|
+
};
|
|
99
|
+
kind: 'write_action' | 'extraction' | 'monitor_change';
|
|
100
|
+
object: 'activity';
|
|
101
|
+
/**
|
|
102
|
+
* Up to 5 other activities on the same subject within 7 days, newest first.
|
|
103
|
+
*/
|
|
104
|
+
related: Array<ActivityRecord.Related>;
|
|
105
|
+
/**
|
|
106
|
+
* The API request behind this activity. Null for activity from before Oct 30,
|
|
107
|
+
* 2026.
|
|
108
|
+
*/
|
|
109
|
+
request: ActivityRecord.Request | null;
|
|
110
|
+
/**
|
|
111
|
+
* ID of the API request behind this activity.
|
|
112
|
+
*/
|
|
113
|
+
requestId: string | null;
|
|
114
|
+
status: 'completed' | 'running' | 'failed' | 'canceled';
|
|
115
|
+
timestamps: ActivityRecord.Timestamps;
|
|
116
|
+
/**
|
|
117
|
+
* Write action type, extraction tool type or monitor change.
|
|
118
|
+
*/
|
|
119
|
+
type: string;
|
|
120
|
+
/**
|
|
121
|
+
* Dashboard page of this activity.
|
|
122
|
+
*/
|
|
123
|
+
url: string;
|
|
124
|
+
}
|
|
125
|
+
export declare namespace ActivityRecord {
|
|
126
|
+
interface Caller {
|
|
127
|
+
/**
|
|
128
|
+
* Name and prefix of the API key used. Never its value.
|
|
129
|
+
*/
|
|
130
|
+
apiKey: Caller.APIKey | null;
|
|
131
|
+
authMethod: 'api_key' | 'oauth' | 'session' | null;
|
|
132
|
+
oauthClient: Caller.OAuthClient | null;
|
|
133
|
+
}
|
|
134
|
+
namespace Caller {
|
|
135
|
+
interface APIKey {
|
|
136
|
+
name: string;
|
|
137
|
+
prefix: string;
|
|
138
|
+
}
|
|
139
|
+
interface OAuthClient {
|
|
140
|
+
id: string;
|
|
141
|
+
name: string;
|
|
142
|
+
}
|
|
143
|
+
}
|
|
144
|
+
interface Charge {
|
|
145
|
+
at: string;
|
|
146
|
+
balanceAfter: number;
|
|
147
|
+
credits: number;
|
|
148
|
+
}
|
|
149
|
+
interface Related {
|
|
150
|
+
id: string;
|
|
151
|
+
createdAt: string;
|
|
152
|
+
status: 'completed' | 'running' | 'failed' | 'canceled';
|
|
153
|
+
type: string;
|
|
154
|
+
url: string;
|
|
155
|
+
}
|
|
156
|
+
interface Request {
|
|
157
|
+
at: string;
|
|
158
|
+
durationMs: number;
|
|
159
|
+
httpStatus: number;
|
|
160
|
+
ipAddress: string | null;
|
|
161
|
+
method: 'DELETE' | 'PATCH' | 'POST' | 'PUT';
|
|
162
|
+
path: string;
|
|
163
|
+
userAgent: string | null;
|
|
164
|
+
}
|
|
165
|
+
interface Timestamps {
|
|
166
|
+
createdAt: string;
|
|
167
|
+
completedAt?: string;
|
|
168
|
+
confirmedAt?: string;
|
|
169
|
+
expiresAt?: string;
|
|
170
|
+
updatedAt?: string;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
export type ActivityListResponse = Array<ActivityLogRow>;
|
|
174
|
+
export interface ActivityListParams {
|
|
175
|
+
/**
|
|
176
|
+
* Activity group, like the Activity page's tabs. `all` by default, or `actions`,
|
|
177
|
+
* `extractions`, `monitors`, `webhooks` or `billing`.
|
|
178
|
+
*/
|
|
179
|
+
category?: string;
|
|
180
|
+
/**
|
|
181
|
+
* Leave it out or pass json to get the rows. Use export for a file.
|
|
182
|
+
*/
|
|
183
|
+
format?: 'json';
|
|
184
|
+
/**
|
|
185
|
+
* Most rows to return, from 1 to 100,000. 100 by default.
|
|
186
|
+
*/
|
|
187
|
+
limit?: number;
|
|
188
|
+
/**
|
|
189
|
+
* Search text.
|
|
190
|
+
*/
|
|
191
|
+
q?: string;
|
|
192
|
+
/**
|
|
193
|
+
* Oldest time, ISO 8601.
|
|
194
|
+
*/
|
|
195
|
+
since?: string;
|
|
196
|
+
/**
|
|
197
|
+
* Comma-separated statuses.
|
|
198
|
+
*/
|
|
199
|
+
status?: string;
|
|
200
|
+
/**
|
|
201
|
+
* Newest time, ISO 8601.
|
|
202
|
+
*/
|
|
203
|
+
until?: string;
|
|
204
|
+
}
|
|
205
|
+
export interface ActivityExportParams extends Omit<ActivityListParams, 'format'> {
|
|
206
|
+
/**
|
|
207
|
+
* File format. PDF stops at 10,000 rows.
|
|
208
|
+
*/
|
|
209
|
+
format: 'csv' | 'json' | 'md' | 'md-document' | 'pdf' | 'txt' | 'xlsx';
|
|
210
|
+
}
|
|
211
|
+
export declare namespace Activity {
|
|
212
|
+
export { type ActivityLogRow as ActivityLogRow, type ActivityRecord as ActivityRecord, type ActivityListResponse as ActivityListResponse, type ActivityListParams as ActivityListParams, type ActivityExportParams as ActivityExportParams, };
|
|
213
|
+
}
|
|
214
|
+
//# sourceMappingURL=activity.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activity.d.ts","sourceRoot":"","sources":["../src/resources/activity.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,4BAAyB;AAC/C,OAAO,EAAE,UAAU,EAAE,+BAA4B;AAEjD,OAAO,EAAE,cAAc,EAAE,uCAAoC;AAG7D;;GAEG;AACH,qBAAa,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;OAaG;IACH,IAAI,CACF,KAAK,GAAE,kBAAkB,GAAG,IAAI,GAAG,SAAc,EACjD,OAAO,CAAC,EAAE,cAAc,GACvB,UAAU,CAAC,oBAAoB,CAAC,CAElC;IAED;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,cAAc,CAAC,CAEzE;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,KAAK,EAAE,oBAAoB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,QAAQ,CAAC,CAOlF;CACF;AAED;;;GAGG;AACH,MAAM,WAAW,cAAc;IAC7B;;OAEG;IACH,EAAE,EAAE,MAAM,CAAC;IAEX,QAAQ,EAAE,MAAM,CAAC;IAEjB,QAAQ,EAAE,MAAM,CAAC;IAEjB;;OAEG;IACH,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IAEzB,OAAO,EAAE,MAAM,CAAC;IAEhB,IAAI,EAAE,MAAM,CAAC;IAEb;;OAEG;IACH,OAAO,EAAE,MAAM,GAAG,MAAM,CAAC;IAEzB,MAAM,EA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AEf;;OAEG;IACH,CAAC,CAAC,EAAE,MAAM,CAAC;IAEX;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IAEf;;OAEG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,oBAAqB,SAAQ,IAAI,CAAC,kBAAkB,EAAE,QAAQ,CAAC;IAC9E;;OAEG;IACH,MAAM,EAAE,KAAK,GAAG,MAAM,GAAG,IAAI,GAAG,aAAa,GAAG,KAAK,GAAG,KAAK,GAAG,MAAM,CAAC;CACxE;AAED,MAAM,CAAC,OAAO,WAAW,QAAQ,CAAC;IAChC,OAAO,EACL,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,oBAAoB,IAAI,oBAAoB,EACjD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,oBAAoB,IAAI,oBAAoB,GAClD,CAAC;CACH"}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
// SPDX-FileCopyrightText: 2026 Xquik contributors
|
|
3
|
+
//
|
|
4
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
5
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
+
exports.Activity = void 0;
|
|
7
|
+
const resource_1 = require("../core/resource.js");
|
|
8
|
+
const headers_1 = require("../internal/headers.js");
|
|
9
|
+
const path_1 = require("../internal/utils/path.js");
|
|
10
|
+
/**
|
|
11
|
+
* Account activity log
|
|
12
|
+
*/
|
|
13
|
+
class Activity extends resource_1.APIResource {
|
|
14
|
+
/**
|
|
15
|
+
* Returns the account's activity log, newest first, with the Activity page's
|
|
16
|
+
* filters. It covers write actions, extractions, monitor changes and events,
|
|
17
|
+
* webhooks, giveaways, media, support, API keys, X account connections and
|
|
18
|
+
* billing.
|
|
19
|
+
*
|
|
20
|
+
* @example
|
|
21
|
+
* ```ts
|
|
22
|
+
* const rows = await client.activity.list({
|
|
23
|
+
* category: 'monitors',
|
|
24
|
+
* limit: 50,
|
|
25
|
+
* });
|
|
26
|
+
* ```
|
|
27
|
+
*/
|
|
28
|
+
list(query = {}, options) {
|
|
29
|
+
return this._client.get('/activity', { query, ...options });
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Returns 1 activity of the account with its full technical record. It covers
|
|
33
|
+
* write actions, extractions and monitor changes. The record holds the request,
|
|
34
|
+
* the caller, the charge, every timestamp in UTC and related activity. It never
|
|
35
|
+
* holds an API key value or another account's data.
|
|
36
|
+
*
|
|
37
|
+
* @example
|
|
38
|
+
* ```ts
|
|
39
|
+
* const activityRecord = await client.activity.retrieve('naF3xqHLWDTs');
|
|
40
|
+
* ```
|
|
41
|
+
*/
|
|
42
|
+
retrieve(id, options) {
|
|
43
|
+
return this._client.get((0, path_1.path) `/activity/${id}`, options);
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Downloads the activity log rows as a CSV, Excel, JSON, Markdown, PDF or text
|
|
47
|
+
* file, with the same filters as list.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* const response = await client.activity.export({ format: 'csv' });
|
|
52
|
+
*
|
|
53
|
+
* const content = await response.blob();
|
|
54
|
+
* console.log(content);
|
|
55
|
+
* ```
|
|
56
|
+
*/
|
|
57
|
+
export(query, options) {
|
|
58
|
+
return this._client.get('/activity', {
|
|
59
|
+
query,
|
|
60
|
+
...options,
|
|
61
|
+
headers: (0, headers_1.buildHeaders)([{ Accept: 'application/octet-stream' }, options?.headers]),
|
|
62
|
+
__binaryResponse: true,
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
exports.Activity = Activity;
|
|
67
|
+
//# sourceMappingURL=activity.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activity.js","sourceRoot":"","sources":["../src/resources/activity.ts"],"names":[],"mappings":";AAAA,kDAAkD;AAClD,EAAE;AACF,sCAAsC;;;AAEtC,kDAA+C;AAE/C,oDAAmD;AAEnD,oDAA8C;AAE9C;;GAEG;AACH,cAAsB,SAAQ,sBAAW;IACvC;;;;;;;;;;;;;OAaG;IACH,IAAI,CACF,KAAK,GAA0C,EAAE,EACjD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAA,WAAI,EAAA,aAAa,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,KAA2B,EAAE,OAAwB;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE;YACnC,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,IAAA,sBAAY,EAAC,CAAC,EAAE,MAAM,EAAE,0BAA0B,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YACjF,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;IACL,CAAC;CACF"}
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
// SPDX-FileCopyrightText: 2026 Xquik contributors
|
|
2
|
+
//
|
|
3
|
+
// SPDX-License-Identifier: Apache-2.0
|
|
4
|
+
import { APIResource } from "../core/resource.mjs";
|
|
5
|
+
import { buildHeaders } from "../internal/headers.mjs";
|
|
6
|
+
import { path } from "../internal/utils/path.mjs";
|
|
7
|
+
/**
|
|
8
|
+
* Account activity log
|
|
9
|
+
*/
|
|
10
|
+
export class Activity extends APIResource {
|
|
11
|
+
/**
|
|
12
|
+
* Returns the account's activity log, newest first, with the Activity page's
|
|
13
|
+
* filters. It covers write actions, extractions, monitor changes and events,
|
|
14
|
+
* webhooks, giveaways, media, support, API keys, X account connections and
|
|
15
|
+
* billing.
|
|
16
|
+
*
|
|
17
|
+
* @example
|
|
18
|
+
* ```ts
|
|
19
|
+
* const rows = await client.activity.list({
|
|
20
|
+
* category: 'monitors',
|
|
21
|
+
* limit: 50,
|
|
22
|
+
* });
|
|
23
|
+
* ```
|
|
24
|
+
*/
|
|
25
|
+
list(query = {}, options) {
|
|
26
|
+
return this._client.get('/activity', { query, ...options });
|
|
27
|
+
}
|
|
28
|
+
/**
|
|
29
|
+
* Returns 1 activity of the account with its full technical record. It covers
|
|
30
|
+
* write actions, extractions and monitor changes. The record holds the request,
|
|
31
|
+
* the caller, the charge, every timestamp in UTC and related activity. It never
|
|
32
|
+
* holds an API key value or another account's data.
|
|
33
|
+
*
|
|
34
|
+
* @example
|
|
35
|
+
* ```ts
|
|
36
|
+
* const activityRecord = await client.activity.retrieve('naF3xqHLWDTs');
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
retrieve(id, options) {
|
|
40
|
+
return this._client.get(path `/activity/${id}`, options);
|
|
41
|
+
}
|
|
42
|
+
/**
|
|
43
|
+
* Downloads the activity log rows as a CSV, Excel, JSON, Markdown, PDF or text
|
|
44
|
+
* file, with the same filters as list.
|
|
45
|
+
*
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* const response = await client.activity.export({ format: 'csv' });
|
|
49
|
+
*
|
|
50
|
+
* const content = await response.blob();
|
|
51
|
+
* console.log(content);
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
export(query, options) {
|
|
55
|
+
return this._client.get('/activity', {
|
|
56
|
+
query,
|
|
57
|
+
...options,
|
|
58
|
+
headers: buildHeaders([{ Accept: 'application/octet-stream' }, options?.headers]),
|
|
59
|
+
__binaryResponse: true,
|
|
60
|
+
});
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
//# sourceMappingURL=activity.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"activity.mjs","sourceRoot":"","sources":["../src/resources/activity.ts"],"names":[],"mappings":"AAAA,kDAAkD;AAClD,EAAE;AACF,sCAAsC;AAEtC,OAAO,EAAE,WAAW,EAAE,6BAAyB;AAE/C,OAAO,EAAE,YAAY,EAAE,gCAA4B;AAEnD,OAAO,EAAE,IAAI,EAAE,mCAA+B;AAE9C;;GAEG;AACH,MAAM,OAAO,QAAS,SAAQ,WAAW;IACvC;;;;;;;;;;;;;OAaG;IACH,IAAI,CACF,KAAK,GAA0C,EAAE,EACjD,OAAwB;QAExB,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE,EAAE,KAAK,EAAE,GAAG,OAAO,EAAE,CAAC,CAAC;IAC9D,CAAC;IAED;;;;;;;;;;OAUG;IACH,QAAQ,CAAC,EAAU,EAAE,OAAwB;QAC3C,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,IAAI,CAAA,aAAa,EAAE,EAAE,EAAE,OAAO,CAAC,CAAC;IAC1D,CAAC;IAED;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,KAA2B,EAAE,OAAwB;QAC1D,OAAO,IAAI,CAAC,OAAO,CAAC,GAAG,CAAC,WAAW,EAAE;YACnC,KAAK;YACL,GAAG,OAAO;YACV,OAAO,EAAE,YAAY,CAAC,CAAC,EAAE,MAAM,EAAE,0BAA0B,EAAE,EAAE,OAAO,EAAE,OAAO,CAAC,CAAC;YACjF,gBAAgB,EAAE,IAAI;SACvB,CAAC,CAAC;IACL,CAAC;CACF"}
|
package/resources/credits.d.mts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { APIResource } from "../core/resource.mjs";
|
|
2
|
+
import * as Shared from "./shared.mjs";
|
|
2
3
|
import { APIPromise } from "../core/api-promise.mjs";
|
|
3
4
|
import { RequestOptions } from "../internal/request-options.mjs";
|
|
4
5
|
/**
|
|
@@ -87,12 +88,30 @@ export interface CreditRetrieveTopupStatusResponse {
|
|
|
87
88
|
* Dollar amount requested for the top-up.
|
|
88
89
|
*/
|
|
89
90
|
amount_dollars?: number | null;
|
|
91
|
+
/**
|
|
92
|
+
* Currency the checkout charged.
|
|
93
|
+
*/
|
|
94
|
+
chargedCurrency?: Shared.Currency;
|
|
95
|
+
/**
|
|
96
|
+
* Amount the checkout charged before tax, in the currency's smallest unit.
|
|
97
|
+
* JPY and KRW have no decimals, so 1580 JPY is ¥1,580.
|
|
98
|
+
*/
|
|
99
|
+
chargedMinorUnits?: number;
|
|
90
100
|
/**
|
|
91
101
|
* Bigint string credit amount granted or pending.
|
|
92
102
|
*/
|
|
93
103
|
credits?: string;
|
|
94
104
|
}
|
|
95
105
|
export interface CreditTopupBalanceResponse {
|
|
106
|
+
/**
|
|
107
|
+
* Currency the checkout charges.
|
|
108
|
+
*/
|
|
109
|
+
chargedCurrency: Shared.Currency;
|
|
110
|
+
/**
|
|
111
|
+
* Amount the checkout charges before tax, in the currency's smallest unit.
|
|
112
|
+
* JPY and KRW have no decimals, so 1580 JPY is ¥1,580.
|
|
113
|
+
*/
|
|
114
|
+
chargedMinorUnits: number;
|
|
96
115
|
/**
|
|
97
116
|
* Stable Xquik redirect URL for the active checkout.
|
|
98
117
|
*/
|
|
@@ -120,6 +139,11 @@ export interface CreditTopupBalanceParams {
|
|
|
120
139
|
* Amount to top up in US dollars. Minimum 10.
|
|
121
140
|
*/
|
|
122
141
|
dollars: number;
|
|
142
|
+
/**
|
|
143
|
+
* Currency to pay in, USD by default. Credits always match the dollar amount.
|
|
144
|
+
* Lowercase codes work too. chargedCurrency shows the currency charged.
|
|
145
|
+
*/
|
|
146
|
+
currency?: Shared.Currency;
|
|
123
147
|
/**
|
|
124
148
|
* Optional site language for Stripe's return page. An unsupported 1 uses en, the
|
|
125
149
|
* default.
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"credits.d.mts","sourceRoot":"","sources":["../src/resources/credits.ts"],"names":[],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