x-twitter-scraper 0.15.0 → 0.17.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 +63 -5
- package/README.md +1 -0
- package/client.d.mts +12 -4
- package/client.d.mts.map +1 -1
- package/client.d.ts +12 -4
- package/client.d.ts.map +1 -1
- package/client.js.map +1 -1
- package/client.mjs.map +1 -1
- package/internal/detect-platform.d.mts +3 -1
- package/internal/detect-platform.d.mts.map +1 -1
- package/internal/detect-platform.d.ts +3 -1
- package/internal/detect-platform.d.ts.map +1 -1
- package/internal/detect-platform.js +1 -1
- package/internal/detect-platform.js.map +1 -1
- package/internal/detect-platform.mjs +1 -1
- package/internal/detect-platform.mjs.map +1 -1
- package/internal/uploads.js +1 -1
- package/internal/uploads.js.map +1 -1
- package/internal/uploads.mjs +1 -1
- package/internal/uploads.mjs.map +1 -1
- package/package.json +2 -2
- package/resources/account.d.mts +5 -0
- package/resources/account.d.mts.map +1 -1
- package/resources/account.d.ts +5 -0
- package/resources/account.d.ts.map +1 -1
- package/resources/compose.d.mts +1 -1
- package/resources/compose.d.mts.map +1 -1
- package/resources/compose.d.ts +1 -1
- package/resources/compose.d.ts.map +1 -1
- package/resources/drafts.d.mts +13 -3
- package/resources/drafts.d.mts.map +1 -1
- package/resources/drafts.d.ts +13 -3
- package/resources/drafts.d.ts.map +1 -1
- package/resources/drafts.js +1 -1
- package/resources/drafts.mjs +1 -1
- package/resources/events.d.mts +100 -29
- package/resources/events.d.mts.map +1 -1
- package/resources/events.d.ts +100 -29
- package/resources/events.d.ts.map +1 -1
- package/resources/events.js.map +1 -1
- package/resources/events.mjs.map +1 -1
- package/resources/index.d.mts +2 -2
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -2
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs.map +1 -1
- package/resources/monitors/index.d.mts +2 -1
- package/resources/monitors/index.d.mts.map +1 -1
- package/resources/monitors/index.d.ts +2 -1
- package/resources/monitors/index.d.ts.map +1 -1
- package/resources/monitors/index.js +3 -1
- package/resources/monitors/index.js.map +1 -1
- package/resources/monitors/index.mjs +1 -0
- package/resources/monitors/index.mjs.map +1 -1
- package/resources/monitors/keywords.d.mts +15 -65
- package/resources/monitors/keywords.d.mts.map +1 -1
- package/resources/monitors/keywords.d.ts +15 -65
- package/resources/monitors/keywords.d.ts.map +1 -1
- package/resources/monitors/monitors.d.mts +12 -5
- package/resources/monitors/monitors.d.mts.map +1 -1
- package/resources/monitors/monitors.d.ts +12 -5
- package/resources/monitors/monitors.d.ts.map +1 -1
- package/resources/monitors/monitors.js +4 -0
- package/resources/monitors/monitors.js.map +1 -1
- package/resources/monitors/monitors.mjs +4 -0
- package/resources/monitors/monitors.mjs.map +1 -1
- package/resources/monitors/posts.d.mts +344 -0
- package/resources/monitors/posts.d.mts.map +1 -0
- package/resources/monitors/posts.d.ts +344 -0
- package/resources/monitors/posts.d.ts.map +1 -0
- package/resources/monitors/posts.js +94 -0
- package/resources/monitors/posts.js.map +1 -0
- package/resources/monitors/posts.mjs +90 -0
- package/resources/monitors/posts.mjs.map +1 -0
- package/resources/shared.d.mts +671 -7
- package/resources/shared.d.mts.map +1 -1
- package/resources/shared.d.ts +671 -7
- package/resources/shared.d.ts.map +1 -1
- package/resources/support/index.d.mts +1 -1
- package/resources/support/index.d.mts.map +1 -1
- package/resources/support/index.d.ts +1 -1
- package/resources/support/index.d.ts.map +1 -1
- package/resources/support/index.js.map +1 -1
- package/resources/support/index.mjs.map +1 -1
- package/resources/support/support.d.mts +2 -2
- package/resources/support/support.d.mts.map +1 -1
- package/resources/support/support.d.ts +2 -2
- package/resources/support/support.d.ts.map +1 -1
- package/resources/support/support.js.map +1 -1
- package/resources/support/support.mjs.map +1 -1
- package/resources/support/tickets.d.mts +26 -25
- package/resources/support/tickets.d.mts.map +1 -1
- package/resources/support/tickets.d.ts +26 -25
- package/resources/support/tickets.d.ts.map +1 -1
- package/resources/support/tickets.js.map +1 -1
- package/resources/support/tickets.mjs.map +1 -1
- package/resources/webhooks.d.mts +10 -4
- package/resources/webhooks.d.mts.map +1 -1
- package/resources/webhooks.d.ts +10 -4
- package/resources/webhooks.d.ts.map +1 -1
- package/resources/webhooks.js.map +1 -1
- package/resources/webhooks.mjs.map +1 -1
- package/resources/x/accounts.d.mts +14 -4
- package/resources/x/accounts.d.mts.map +1 -1
- package/resources/x/accounts.d.ts +14 -4
- package/resources/x/accounts.d.ts.map +1 -1
- package/resources/x/accounts.js +6 -4
- package/resources/x/accounts.js.map +1 -1
- package/resources/x/accounts.mjs +6 -4
- package/resources/x/accounts.mjs.map +1 -1
- package/resources/x/broadcasts.d.mts +3 -127
- package/resources/x/broadcasts.d.mts.map +1 -1
- package/resources/x/broadcasts.d.ts +3 -127
- package/resources/x/broadcasts.d.ts.map +1 -1
- package/resources/x/communities/communities.d.mts +92 -1
- package/resources/x/communities/communities.d.mts.map +1 -1
- package/resources/x/communities/communities.d.ts +92 -1
- package/resources/x/communities/communities.d.ts.map +1 -1
- package/resources/x/communities/communities.js +14 -0
- package/resources/x/communities/communities.js.map +1 -1
- package/resources/x/communities/communities.mjs +14 -0
- package/resources/x/communities/communities.mjs.map +1 -1
- package/resources/x/communities/index.d.mts +1 -1
- package/resources/x/communities/index.d.mts.map +1 -1
- package/resources/x/communities/index.d.ts +1 -1
- package/resources/x/communities/index.d.ts.map +1 -1
- package/resources/x/communities/index.js.map +1 -1
- package/resources/x/communities/index.mjs.map +1 -1
- package/resources/x/community-notes.d.mts +122 -510
- package/resources/x/community-notes.d.mts.map +1 -1
- package/resources/x/community-notes.d.ts +122 -510
- package/resources/x/community-notes.d.ts.map +1 -1
- package/resources/x/community-notes.js.map +1 -1
- package/resources/x/community-notes.mjs.map +1 -1
- package/resources/x/index.d.mts +7 -6
- package/resources/x/index.d.mts.map +1 -1
- package/resources/x/index.d.ts +7 -6
- package/resources/x/index.d.ts.map +1 -1
- package/resources/x/index.js +3 -1
- package/resources/x/index.js.map +1 -1
- package/resources/x/index.mjs +1 -0
- package/resources/x/index.mjs.map +1 -1
- package/resources/x/jobs.d.mts +144 -283
- package/resources/x/jobs.d.mts.map +1 -1
- package/resources/x/jobs.d.ts +144 -283
- package/resources/x/jobs.d.ts.map +1 -1
- package/resources/x/jobs.js.map +1 -1
- package/resources/x/jobs.mjs.map +1 -1
- package/resources/x/lists.d.mts +27 -425
- package/resources/x/lists.d.mts.map +1 -1
- package/resources/x/lists.d.ts +27 -425
- package/resources/x/lists.d.ts.map +1 -1
- package/resources/x/media.d.mts +13 -2
- package/resources/x/media.d.mts.map +1 -1
- package/resources/x/media.d.ts +13 -2
- package/resources/x/media.d.ts.map +1 -1
- package/resources/x/media.js.map +1 -1
- package/resources/x/media.mjs.map +1 -1
- package/resources/x/profile.d.mts +13 -4
- package/resources/x/profile.d.mts.map +1 -1
- package/resources/x/profile.d.ts +13 -4
- package/resources/x/profile.d.ts.map +1 -1
- package/resources/x/profile.js.map +1 -1
- package/resources/x/profile.mjs.map +1 -1
- package/resources/x/spaces.d.mts +213 -669
- package/resources/x/spaces.d.mts.map +1 -1
- package/resources/x/spaces.d.ts +213 -669
- package/resources/x/spaces.d.ts.map +1 -1
- package/resources/x/spaces.js.map +1 -1
- package/resources/x/spaces.mjs.map +1 -1
- package/resources/x/sports.d.mts +1349 -0
- package/resources/x/sports.d.mts.map +1 -0
- package/resources/x/sports.d.ts +1349 -0
- package/resources/x/sports.d.ts.map +1 -0
- package/resources/x/sports.js +76 -0
- package/resources/x/sports.js.map +1 -0
- package/resources/x/sports.mjs +72 -0
- package/resources/x/sports.mjs.map +1 -0
- package/resources/x/tweets/tweets.d.mts +32 -24
- package/resources/x/tweets/tweets.d.mts.map +1 -1
- package/resources/x/tweets/tweets.d.ts +32 -24
- 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/users/users.d.mts +62 -614
- package/resources/x/users/users.d.mts.map +1 -1
- package/resources/x/users/users.d.ts +62 -614
- package/resources/x/users/users.d.ts.map +1 -1
- package/resources/x/users/users.js.map +1 -1
- package/resources/x/users/users.mjs.map +1 -1
- package/resources/x/x.d.mts +63 -118
- package/resources/x/x.d.mts.map +1 -1
- package/resources/x/x.d.ts +63 -118
- package/resources/x/x.d.ts.map +1 -1
- package/resources/x/x.js +4 -0
- package/resources/x/x.js.map +1 -1
- package/resources/x/x.mjs +4 -0
- package/resources/x/x.mjs.map +1 -1
- package/skills/x-twitter-scraper/references/api-endpoints-x-api.md +1 -0
- package/src/client.ts +12 -0
- package/src/internal/detect-platform.ts +2 -2
- package/src/internal/uploads.ts +1 -1
- package/src/resources/account.ts +6 -0
- package/src/resources/compose.ts +1 -1
- package/src/resources/drafts.ts +14 -2
- package/src/resources/events.ts +137 -29
- package/src/resources/index.ts +2 -0
- package/src/resources/monitors/index.ts +21 -0
- package/src/resources/monitors/keywords.ts +15 -79
- package/src/resources/monitors/monitors.ts +52 -3
- package/src/resources/monitors/posts.ts +463 -0
- package/src/resources/shared.ts +897 -215
- package/src/resources/support/index.ts +1 -0
- package/src/resources/support/support.ts +2 -0
- package/src/resources/support/tickets.ts +29 -25
- package/src/resources/webhooks.ts +11 -4
- package/src/resources/x/accounts.ts +19 -4
- package/src/resources/x/broadcasts.ts +3 -154
- package/src/resources/x/communities/communities.ts +113 -0
- package/src/resources/x/communities/index.ts +3 -0
- package/src/resources/x/community-notes.ts +137 -582
- package/src/resources/x/index.ts +62 -0
- package/src/resources/x/jobs.ts +160 -324
- package/src/resources/x/lists.ts +27 -499
- package/src/resources/x/media.ts +15 -2
- package/src/resources/x/profile.ts +15 -4
- package/src/resources/x/spaces.ts +227 -787
- package/src/resources/x/sports.ts +1675 -0
- package/src/resources/x/tweets/tweets.ts +41 -26
- package/src/resources/x/users/users.ts +62 -721
- package/src/resources/x/x.ts +185 -128
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
- package/src/lib/.keep +0 -2
|
@@ -0,0 +1,344 @@
|
|
|
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
|
+
* Post monitoring with replies, quotes, edits, deletion & 6 metrics
|
|
6
|
+
*/
|
|
7
|
+
export declare class Posts extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Creates a monitor for 1 X post. It tracks replies, quotes, edits, deletion
|
|
10
|
+
* & 6 metrics, for 30 credits an hour with events & webhook deliveries
|
|
11
|
+
* included. That hourly price is a monitor's only charge. Creation needs the
|
|
12
|
+
* credits of the first hour & reads the post once.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const postMonitor = await client.monitors.posts.create({
|
|
17
|
+
* post: 'https://x.com/xquik/status/2104984505677430978',
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
create(body: PostCreateParams, options?: RequestOptions): APIPromise<PostMonitor>;
|
|
22
|
+
/**
|
|
23
|
+
* Returns 1 post monitor with its post & the 6 metrics, each with its current
|
|
24
|
+
* value & gain since tracking began.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* const postMonitor = await client.monitors.posts.retrieve('id');
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<PostMonitor>;
|
|
32
|
+
/**
|
|
33
|
+
* Updates a post monitor's label, event types or active state. Turning a
|
|
34
|
+
* paused monitor on reads the post first, & answers 409 while X hides it.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* const postMonitor = await client.monitors.posts.update('id', {
|
|
39
|
+
* isActive: false,
|
|
40
|
+
* });
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
update(id: string, body: PostUpdateParams, options?: RequestOptions): APIPromise<PostMonitor>;
|
|
44
|
+
/**
|
|
45
|
+
* Returns post monitors with each post's 6 metrics, their current values &
|
|
46
|
+
* gains since tracking began.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* const posts = await client.monitors.posts.list();
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
list(query?: PostListParams | null | undefined, options?: RequestOptions): APIPromise<PostListResponse>;
|
|
54
|
+
/**
|
|
55
|
+
* Stops 1 post monitor, then removes its stored events & metric history in
|
|
56
|
+
* bounded batches. Poll statusUrl until the monitor returns 404.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* const post = await client.monitors.posts.delete('id');
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
delete(id: string, options?: RequestOptions): APIPromise<PostDeleteResponse>;
|
|
64
|
+
/**
|
|
65
|
+
* Returns 1 bucket per hour with each metric's value at the hour's end & its
|
|
66
|
+
* gain over that hour. The last bucket is the current hour. Hours before
|
|
67
|
+
* tracking began carry the starting values with a gain of 0.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```ts
|
|
71
|
+
* const postMonitorMetrics = await client.monitors.posts.retrieveMetrics('id');
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
retrieveMetrics(id: string, query?: PostRetrieveMetricsParams | null | undefined, options?: RequestOptions): APIPromise<PostMonitorMetrics>;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* A post event type.
|
|
78
|
+
*/
|
|
79
|
+
export type PostEventType = 'post.reply.new' | 'post.quote.new' | 'post.likes.changed' | 'post.retweets.changed' | 'post.replies.changed' | 'post.quotes.changed' | 'post.bookmarks.changed' | 'post.views.changed' | 'post.edited' | 'post.deleted';
|
|
80
|
+
/**
|
|
81
|
+
* A metric's current value & its gain since tracking began. Both are null when
|
|
82
|
+
* X shows no count, as for views on old posts.
|
|
83
|
+
*/
|
|
84
|
+
export interface PostMetricReading {
|
|
85
|
+
current: number | null;
|
|
86
|
+
gain: number | null;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* The 6 metrics of a post.
|
|
90
|
+
*/
|
|
91
|
+
export interface PostMetrics {
|
|
92
|
+
/**
|
|
93
|
+
* A metric's current value & its gain since tracking began. Both are null
|
|
94
|
+
* when X shows no count, as for views on old posts.
|
|
95
|
+
*/
|
|
96
|
+
views: PostMetricReading;
|
|
97
|
+
/**
|
|
98
|
+
* A metric's current value & its gain since tracking began. Both are null
|
|
99
|
+
* when X shows no count, as for views on old posts.
|
|
100
|
+
*/
|
|
101
|
+
likes: PostMetricReading;
|
|
102
|
+
/**
|
|
103
|
+
* A metric's current value & its gain since tracking began. Both are null
|
|
104
|
+
* when X shows no count, as for views on old posts.
|
|
105
|
+
*/
|
|
106
|
+
retweets: PostMetricReading;
|
|
107
|
+
/**
|
|
108
|
+
* A metric's current value & its gain since tracking began. Both are null
|
|
109
|
+
* when X shows no count, as for views on old posts.
|
|
110
|
+
*/
|
|
111
|
+
replies: PostMetricReading;
|
|
112
|
+
/**
|
|
113
|
+
* A metric's current value & its gain since tracking began. Both are null
|
|
114
|
+
* when X shows no count, as for views on old posts.
|
|
115
|
+
*/
|
|
116
|
+
quotes: PostMetricReading;
|
|
117
|
+
/**
|
|
118
|
+
* A metric's current value & its gain since tracking began. Both are null
|
|
119
|
+
* when X shows no count, as for views on old posts.
|
|
120
|
+
*/
|
|
121
|
+
bookmarks: PostMetricReading;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Post monitor that tracks 1 X post's replies, quotes, edits & metrics.
|
|
125
|
+
*/
|
|
126
|
+
export interface PostMonitor {
|
|
127
|
+
id: string;
|
|
128
|
+
/**
|
|
129
|
+
* ID of the post you gave.
|
|
130
|
+
*/
|
|
131
|
+
postId: string;
|
|
132
|
+
postUrl: string;
|
|
133
|
+
/**
|
|
134
|
+
* Permanent X user ID of the post's author.
|
|
135
|
+
*/
|
|
136
|
+
authorId: string;
|
|
137
|
+
authorUsername: string;
|
|
138
|
+
authorName: string;
|
|
139
|
+
/**
|
|
140
|
+
* Text of the newest version Xquik read.
|
|
141
|
+
*/
|
|
142
|
+
text: string;
|
|
143
|
+
postedAt: string;
|
|
144
|
+
/**
|
|
145
|
+
* Post event types to send. Without it, a monitor sends new replies, new
|
|
146
|
+
* quotes, like & retweet changes, edits & deletion.
|
|
147
|
+
*/
|
|
148
|
+
eventTypes: Array<PostEventType>;
|
|
149
|
+
isActive: boolean;
|
|
150
|
+
createdAt: string;
|
|
151
|
+
/**
|
|
152
|
+
* Next hourly credit charge time for this post monitor.
|
|
153
|
+
*/
|
|
154
|
+
nextBillingAt: string;
|
|
155
|
+
/**
|
|
156
|
+
* The 6 metrics of a post.
|
|
157
|
+
*/
|
|
158
|
+
metrics: PostMetrics;
|
|
159
|
+
/**
|
|
160
|
+
* Customer-set label of the post monitor, when set.
|
|
161
|
+
*/
|
|
162
|
+
name?: string;
|
|
163
|
+
/**
|
|
164
|
+
* Why Xquik paused this post monitor. insufficient_credits means the balance
|
|
165
|
+
* could not pay an hour, so add credits & resume. The other 3 mean X stopped
|
|
166
|
+
* showing the post. Absent when the monitor is active or you paused it
|
|
167
|
+
* yourself.
|
|
168
|
+
*/
|
|
169
|
+
pausedReason?: 'insufficient_credits' | 'x_post_deleted' | 'x_post_protected' | 'x_post_unavailable';
|
|
170
|
+
/**
|
|
171
|
+
* When Xquik paused this post monitor.
|
|
172
|
+
*/
|
|
173
|
+
pausedAt?: string;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* A metric's value at the hour's end & its gain over that hour. Both are null
|
|
177
|
+
* when X shows no count.
|
|
178
|
+
*/
|
|
179
|
+
export interface PostMetricPoint {
|
|
180
|
+
value: number | null;
|
|
181
|
+
gain: number | null;
|
|
182
|
+
}
|
|
183
|
+
export interface PostMonitorMetricsBucketMetrics {
|
|
184
|
+
/**
|
|
185
|
+
* A metric's value at the hour's end & its gain over that hour. Both are null
|
|
186
|
+
* when X shows no count.
|
|
187
|
+
*/
|
|
188
|
+
views: PostMetricPoint;
|
|
189
|
+
/**
|
|
190
|
+
* A metric's value at the hour's end & its gain over that hour. Both are null
|
|
191
|
+
* when X shows no count.
|
|
192
|
+
*/
|
|
193
|
+
likes: PostMetricPoint;
|
|
194
|
+
/**
|
|
195
|
+
* A metric's value at the hour's end & its gain over that hour. Both are null
|
|
196
|
+
* when X shows no count.
|
|
197
|
+
*/
|
|
198
|
+
retweets: PostMetricPoint;
|
|
199
|
+
/**
|
|
200
|
+
* A metric's value at the hour's end & its gain over that hour. Both are null
|
|
201
|
+
* when X shows no count.
|
|
202
|
+
*/
|
|
203
|
+
replies: PostMetricPoint;
|
|
204
|
+
/**
|
|
205
|
+
* A metric's value at the hour's end & its gain over that hour. Both are null
|
|
206
|
+
* when X shows no count.
|
|
207
|
+
*/
|
|
208
|
+
quotes: PostMetricPoint;
|
|
209
|
+
/**
|
|
210
|
+
* A metric's value at the hour's end & its gain over that hour. Both are null
|
|
211
|
+
* when X shows no count.
|
|
212
|
+
*/
|
|
213
|
+
bookmarks: PostMetricPoint;
|
|
214
|
+
}
|
|
215
|
+
export interface PostMonitorMetricsBucket {
|
|
216
|
+
/**
|
|
217
|
+
* Start of the hour.
|
|
218
|
+
*/
|
|
219
|
+
at: string;
|
|
220
|
+
metrics: PostMonitorMetricsBucketMetrics;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Hourly metric buckets of 1 post monitor, oldest first.
|
|
224
|
+
*/
|
|
225
|
+
export interface PostMonitorMetrics {
|
|
226
|
+
hours: number;
|
|
227
|
+
buckets: Array<PostMonitorMetricsBucket>;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* A post metric's change since its last event, on post.likes.changed,
|
|
231
|
+
* post.retweets.changed, post.replies.changed, post.quotes.changed,
|
|
232
|
+
* post.bookmarks.changed & post.views.changed.
|
|
233
|
+
*/
|
|
234
|
+
export interface MonitorPostMetricChange {
|
|
235
|
+
/**
|
|
236
|
+
* Current count minus previous count.
|
|
237
|
+
*/
|
|
238
|
+
change: number;
|
|
239
|
+
/**
|
|
240
|
+
* The count X shows now.
|
|
241
|
+
*/
|
|
242
|
+
current: number;
|
|
243
|
+
/**
|
|
244
|
+
* The metric that changed.
|
|
245
|
+
*/
|
|
246
|
+
metric: 'bookmarks' | 'likes' | 'quotes' | 'replies' | 'retweets' | 'views';
|
|
247
|
+
/**
|
|
248
|
+
* The count the last event of this metric reported.
|
|
249
|
+
*/
|
|
250
|
+
previous: number;
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* The post's text before & after an edit, on post.edited.
|
|
254
|
+
*/
|
|
255
|
+
export interface MonitorPostEdit {
|
|
256
|
+
/**
|
|
257
|
+
* The text before the edit.
|
|
258
|
+
*/
|
|
259
|
+
previousText: string;
|
|
260
|
+
/**
|
|
261
|
+
* The text of the newest version.
|
|
262
|
+
*/
|
|
263
|
+
text: string;
|
|
264
|
+
/**
|
|
265
|
+
* X's ID of the newest version of the post.
|
|
266
|
+
*/
|
|
267
|
+
versionId: string;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* The last text the monitor saw, on post.deleted.
|
|
271
|
+
*/
|
|
272
|
+
export interface MonitorPostDeleted {
|
|
273
|
+
/**
|
|
274
|
+
* The post's text before its author deleted it.
|
|
275
|
+
*/
|
|
276
|
+
text: string;
|
|
277
|
+
}
|
|
278
|
+
export interface PostListResponse {
|
|
279
|
+
hasMore: boolean;
|
|
280
|
+
monitors: Array<PostMonitor>;
|
|
281
|
+
/**
|
|
282
|
+
* Post monitors on this page.
|
|
283
|
+
*/
|
|
284
|
+
total: number;
|
|
285
|
+
nextCursor?: string;
|
|
286
|
+
}
|
|
287
|
+
export interface PostDeleteResponse {
|
|
288
|
+
deletionStatus: 'deleting';
|
|
289
|
+
/**
|
|
290
|
+
* Poll this monitor URL until it returns 404.
|
|
291
|
+
*/
|
|
292
|
+
statusUrl: string;
|
|
293
|
+
success: true;
|
|
294
|
+
}
|
|
295
|
+
export interface PostCreateParams {
|
|
296
|
+
/**
|
|
297
|
+
* Post link or ID. x.com, twitter.com, mobile & /i/web/status/ links work
|
|
298
|
+
* with any query string.
|
|
299
|
+
*/
|
|
300
|
+
post: string;
|
|
301
|
+
/**
|
|
302
|
+
* Post event types to send. Without it, a monitor sends new replies, new
|
|
303
|
+
* quotes, like & retweet changes, edits & deletion.
|
|
304
|
+
*/
|
|
305
|
+
eventTypes?: Array<PostEventType>;
|
|
306
|
+
/**
|
|
307
|
+
* Your own label for the post monitor. Its events carry it as monitorName.
|
|
308
|
+
*/
|
|
309
|
+
name?: string | null;
|
|
310
|
+
}
|
|
311
|
+
export interface PostUpdateParams {
|
|
312
|
+
/**
|
|
313
|
+
* Post event types to send. Without it, a monitor sends new replies, new
|
|
314
|
+
* quotes, like & retweet changes, edits & deletion.
|
|
315
|
+
*/
|
|
316
|
+
eventTypes?: Array<PostEventType>;
|
|
317
|
+
isActive?: boolean;
|
|
318
|
+
/**
|
|
319
|
+
* New label for the post monitor. Send null to remove it.
|
|
320
|
+
*/
|
|
321
|
+
name?: string | null;
|
|
322
|
+
}
|
|
323
|
+
export interface PostListParams {
|
|
324
|
+
/**
|
|
325
|
+
* Previous nextCursor. The after alias also works. Offset pagination is not
|
|
326
|
+
* supported.
|
|
327
|
+
*/
|
|
328
|
+
cursor?: string;
|
|
329
|
+
/**
|
|
330
|
+
* Maximum items per page, from 1 to 200. Default 200. Pass nextCursor as
|
|
331
|
+
* cursor for the next page.
|
|
332
|
+
*/
|
|
333
|
+
limit?: number;
|
|
334
|
+
}
|
|
335
|
+
export interface PostRetrieveMetricsParams {
|
|
336
|
+
/**
|
|
337
|
+
* Hours to return, from 1 to 720.
|
|
338
|
+
*/
|
|
339
|
+
hours?: number;
|
|
340
|
+
}
|
|
341
|
+
export declare namespace Posts {
|
|
342
|
+
export { type PostEventType as PostEventType, type PostMetricReading as PostMetricReading, type PostMetrics as PostMetrics, type PostMonitor as PostMonitor, type PostMetricPoint as PostMetricPoint, type PostMonitorMetricsBucketMetrics as PostMonitorMetricsBucketMetrics, type PostMonitorMetricsBucket as PostMonitorMetricsBucket, type PostMonitorMetrics as PostMonitorMetrics, type MonitorPostMetricChange as MonitorPostMetricChange, type MonitorPostEdit as MonitorPostEdit, type MonitorPostDeleted as MonitorPostDeleted, type PostListResponse as PostListResponse, type PostDeleteResponse as PostDeleteResponse, type PostCreateParams as PostCreateParams, type PostUpdateParams as PostUpdateParams, type PostListParams as PostListParams, type PostRetrieveMetricsParams as PostRetrieveMetricsParams, };
|
|
343
|
+
}
|
|
344
|
+
//# sourceMappingURL=posts.d.mts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"posts.d.mts","sourceRoot":"","sources":["../../src/resources/monitors/posts.ts"],"names":[],"mappings":"AAIA,OAAO,EAAE,WAAW,EAAE,gCAA4B;AAClD,OAAO,EAAE,UAAU,EAAE,mCAA+B;AACpD,OAAO,EAAE,cAAc,EAAE,2CAAuC;AAGhE;;GAEG;AACH,qBAAa,KAAM,SAAQ,WAAW;IACpC;;;;;;;;;;;;OAYG;IACH,MAAM,CAAC,IAAI,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,WAAW,CAAC,CAEhF;IAED;;;;;;;;OAQG;IACH,QAAQ,CAAC,EAAE,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,WAAW,CAAC,CAEtE;IAED;;;;;;;;;;OAUG;IACH,MAAM,CAAC,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,UAAU,CAAC,WAAW,CAAC,CAE5F;IAED;;;;;;;;OAQG;IACH,IA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,CAAC;CACtB;AAED,MAAM,WAAW,cAAc;IAC7B;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAEhB;;;OAGG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,WAAW,yBAAyB;IACxC;;OAEG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED,MAAM,CAAC,OAAO,WAAW,KAAK,CAAC;IAC7B,OAAO,EACL,KAAK,aAAa,IAAI,aAAa,EACnC,KAAK,iBAAiB,IAAI,iBAAiB,EAC3C,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,WAAW,IAAI,WAAW,EAC/B,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,+BAA+B,IAAI,+BAA+B,EACvE,KAAK,wBAAwB,IAAI,wBAAwB,EACzD,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,uBAAuB,IAAI,uBAAuB,EACvD,KAAK,eAAe,IAAI,eAAe,EACvC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,kBAAkB,IAAI,kBAAkB,EAC7C,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,gBAAgB,IAAI,gBAAgB,EACzC,KAAK,cAAc,IAAI,cAAc,EACrC,KAAK,yBAAyB,IAAI,yBAAyB,GAC5D,CAAC;CACH"}
|
|
@@ -0,0 +1,344 @@
|
|
|
1
|
+
import { APIResource } from "../../core/resource.js";
|
|
2
|
+
import { APIPromise } from "../../core/api-promise.js";
|
|
3
|
+
import { RequestOptions } from "../../internal/request-options.js";
|
|
4
|
+
/**
|
|
5
|
+
* Post monitoring with replies, quotes, edits, deletion & 6 metrics
|
|
6
|
+
*/
|
|
7
|
+
export declare class Posts extends APIResource {
|
|
8
|
+
/**
|
|
9
|
+
* Creates a monitor for 1 X post. It tracks replies, quotes, edits, deletion
|
|
10
|
+
* & 6 metrics, for 30 credits an hour with events & webhook deliveries
|
|
11
|
+
* included. That hourly price is a monitor's only charge. Creation needs the
|
|
12
|
+
* credits of the first hour & reads the post once.
|
|
13
|
+
*
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const postMonitor = await client.monitors.posts.create({
|
|
17
|
+
* post: 'https://x.com/xquik/status/2104984505677430978',
|
|
18
|
+
* });
|
|
19
|
+
* ```
|
|
20
|
+
*/
|
|
21
|
+
create(body: PostCreateParams, options?: RequestOptions): APIPromise<PostMonitor>;
|
|
22
|
+
/**
|
|
23
|
+
* Returns 1 post monitor with its post & the 6 metrics, each with its current
|
|
24
|
+
* value & gain since tracking began.
|
|
25
|
+
*
|
|
26
|
+
* @example
|
|
27
|
+
* ```ts
|
|
28
|
+
* const postMonitor = await client.monitors.posts.retrieve('id');
|
|
29
|
+
* ```
|
|
30
|
+
*/
|
|
31
|
+
retrieve(id: string, options?: RequestOptions): APIPromise<PostMonitor>;
|
|
32
|
+
/**
|
|
33
|
+
* Updates a post monitor's label, event types or active state. Turning a
|
|
34
|
+
* paused monitor on reads the post first, & answers 409 while X hides it.
|
|
35
|
+
*
|
|
36
|
+
* @example
|
|
37
|
+
* ```ts
|
|
38
|
+
* const postMonitor = await client.monitors.posts.update('id', {
|
|
39
|
+
* isActive: false,
|
|
40
|
+
* });
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
update(id: string, body: PostUpdateParams, options?: RequestOptions): APIPromise<PostMonitor>;
|
|
44
|
+
/**
|
|
45
|
+
* Returns post monitors with each post's 6 metrics, their current values &
|
|
46
|
+
* gains since tracking began.
|
|
47
|
+
*
|
|
48
|
+
* @example
|
|
49
|
+
* ```ts
|
|
50
|
+
* const posts = await client.monitors.posts.list();
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
list(query?: PostListParams | null | undefined, options?: RequestOptions): APIPromise<PostListResponse>;
|
|
54
|
+
/**
|
|
55
|
+
* Stops 1 post monitor, then removes its stored events & metric history in
|
|
56
|
+
* bounded batches. Poll statusUrl until the monitor returns 404.
|
|
57
|
+
*
|
|
58
|
+
* @example
|
|
59
|
+
* ```ts
|
|
60
|
+
* const post = await client.monitors.posts.delete('id');
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
delete(id: string, options?: RequestOptions): APIPromise<PostDeleteResponse>;
|
|
64
|
+
/**
|
|
65
|
+
* Returns 1 bucket per hour with each metric's value at the hour's end & its
|
|
66
|
+
* gain over that hour. The last bucket is the current hour. Hours before
|
|
67
|
+
* tracking began carry the starting values with a gain of 0.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```ts
|
|
71
|
+
* const postMonitorMetrics = await client.monitors.posts.retrieveMetrics('id');
|
|
72
|
+
* ```
|
|
73
|
+
*/
|
|
74
|
+
retrieveMetrics(id: string, query?: PostRetrieveMetricsParams | null | undefined, options?: RequestOptions): APIPromise<PostMonitorMetrics>;
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* A post event type.
|
|
78
|
+
*/
|
|
79
|
+
export type PostEventType = 'post.reply.new' | 'post.quote.new' | 'post.likes.changed' | 'post.retweets.changed' | 'post.replies.changed' | 'post.quotes.changed' | 'post.bookmarks.changed' | 'post.views.changed' | 'post.edited' | 'post.deleted';
|
|
80
|
+
/**
|
|
81
|
+
* A metric's current value & its gain since tracking began. Both are null when
|
|
82
|
+
* X shows no count, as for views on old posts.
|
|
83
|
+
*/
|
|
84
|
+
export interface PostMetricReading {
|
|
85
|
+
current: number | null;
|
|
86
|
+
gain: number | null;
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* The 6 metrics of a post.
|
|
90
|
+
*/
|
|
91
|
+
export interface PostMetrics {
|
|
92
|
+
/**
|
|
93
|
+
* A metric's current value & its gain since tracking began. Both are null
|
|
94
|
+
* when X shows no count, as for views on old posts.
|
|
95
|
+
*/
|
|
96
|
+
views: PostMetricReading;
|
|
97
|
+
/**
|
|
98
|
+
* A metric's current value & its gain since tracking began. Both are null
|
|
99
|
+
* when X shows no count, as for views on old posts.
|
|
100
|
+
*/
|
|
101
|
+
likes: PostMetricReading;
|
|
102
|
+
/**
|
|
103
|
+
* A metric's current value & its gain since tracking began. Both are null
|
|
104
|
+
* when X shows no count, as for views on old posts.
|
|
105
|
+
*/
|
|
106
|
+
retweets: PostMetricReading;
|
|
107
|
+
/**
|
|
108
|
+
* A metric's current value & its gain since tracking began. Both are null
|
|
109
|
+
* when X shows no count, as for views on old posts.
|
|
110
|
+
*/
|
|
111
|
+
replies: PostMetricReading;
|
|
112
|
+
/**
|
|
113
|
+
* A metric's current value & its gain since tracking began. Both are null
|
|
114
|
+
* when X shows no count, as for views on old posts.
|
|
115
|
+
*/
|
|
116
|
+
quotes: PostMetricReading;
|
|
117
|
+
/**
|
|
118
|
+
* A metric's current value & its gain since tracking began. Both are null
|
|
119
|
+
* when X shows no count, as for views on old posts.
|
|
120
|
+
*/
|
|
121
|
+
bookmarks: PostMetricReading;
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* Post monitor that tracks 1 X post's replies, quotes, edits & metrics.
|
|
125
|
+
*/
|
|
126
|
+
export interface PostMonitor {
|
|
127
|
+
id: string;
|
|
128
|
+
/**
|
|
129
|
+
* ID of the post you gave.
|
|
130
|
+
*/
|
|
131
|
+
postId: string;
|
|
132
|
+
postUrl: string;
|
|
133
|
+
/**
|
|
134
|
+
* Permanent X user ID of the post's author.
|
|
135
|
+
*/
|
|
136
|
+
authorId: string;
|
|
137
|
+
authorUsername: string;
|
|
138
|
+
authorName: string;
|
|
139
|
+
/**
|
|
140
|
+
* Text of the newest version Xquik read.
|
|
141
|
+
*/
|
|
142
|
+
text: string;
|
|
143
|
+
postedAt: string;
|
|
144
|
+
/**
|
|
145
|
+
* Post event types to send. Without it, a monitor sends new replies, new
|
|
146
|
+
* quotes, like & retweet changes, edits & deletion.
|
|
147
|
+
*/
|
|
148
|
+
eventTypes: Array<PostEventType>;
|
|
149
|
+
isActive: boolean;
|
|
150
|
+
createdAt: string;
|
|
151
|
+
/**
|
|
152
|
+
* Next hourly credit charge time for this post monitor.
|
|
153
|
+
*/
|
|
154
|
+
nextBillingAt: string;
|
|
155
|
+
/**
|
|
156
|
+
* The 6 metrics of a post.
|
|
157
|
+
*/
|
|
158
|
+
metrics: PostMetrics;
|
|
159
|
+
/**
|
|
160
|
+
* Customer-set label of the post monitor, when set.
|
|
161
|
+
*/
|
|
162
|
+
name?: string;
|
|
163
|
+
/**
|
|
164
|
+
* Why Xquik paused this post monitor. insufficient_credits means the balance
|
|
165
|
+
* could not pay an hour, so add credits & resume. The other 3 mean X stopped
|
|
166
|
+
* showing the post. Absent when the monitor is active or you paused it
|
|
167
|
+
* yourself.
|
|
168
|
+
*/
|
|
169
|
+
pausedReason?: 'insufficient_credits' | 'x_post_deleted' | 'x_post_protected' | 'x_post_unavailable';
|
|
170
|
+
/**
|
|
171
|
+
* When Xquik paused this post monitor.
|
|
172
|
+
*/
|
|
173
|
+
pausedAt?: string;
|
|
174
|
+
}
|
|
175
|
+
/**
|
|
176
|
+
* A metric's value at the hour's end & its gain over that hour. Both are null
|
|
177
|
+
* when X shows no count.
|
|
178
|
+
*/
|
|
179
|
+
export interface PostMetricPoint {
|
|
180
|
+
value: number | null;
|
|
181
|
+
gain: number | null;
|
|
182
|
+
}
|
|
183
|
+
export interface PostMonitorMetricsBucketMetrics {
|
|
184
|
+
/**
|
|
185
|
+
* A metric's value at the hour's end & its gain over that hour. Both are null
|
|
186
|
+
* when X shows no count.
|
|
187
|
+
*/
|
|
188
|
+
views: PostMetricPoint;
|
|
189
|
+
/**
|
|
190
|
+
* A metric's value at the hour's end & its gain over that hour. Both are null
|
|
191
|
+
* when X shows no count.
|
|
192
|
+
*/
|
|
193
|
+
likes: PostMetricPoint;
|
|
194
|
+
/**
|
|
195
|
+
* A metric's value at the hour's end & its gain over that hour. Both are null
|
|
196
|
+
* when X shows no count.
|
|
197
|
+
*/
|
|
198
|
+
retweets: PostMetricPoint;
|
|
199
|
+
/**
|
|
200
|
+
* A metric's value at the hour's end & its gain over that hour. Both are null
|
|
201
|
+
* when X shows no count.
|
|
202
|
+
*/
|
|
203
|
+
replies: PostMetricPoint;
|
|
204
|
+
/**
|
|
205
|
+
* A metric's value at the hour's end & its gain over that hour. Both are null
|
|
206
|
+
* when X shows no count.
|
|
207
|
+
*/
|
|
208
|
+
quotes: PostMetricPoint;
|
|
209
|
+
/**
|
|
210
|
+
* A metric's value at the hour's end & its gain over that hour. Both are null
|
|
211
|
+
* when X shows no count.
|
|
212
|
+
*/
|
|
213
|
+
bookmarks: PostMetricPoint;
|
|
214
|
+
}
|
|
215
|
+
export interface PostMonitorMetricsBucket {
|
|
216
|
+
/**
|
|
217
|
+
* Start of the hour.
|
|
218
|
+
*/
|
|
219
|
+
at: string;
|
|
220
|
+
metrics: PostMonitorMetricsBucketMetrics;
|
|
221
|
+
}
|
|
222
|
+
/**
|
|
223
|
+
* Hourly metric buckets of 1 post monitor, oldest first.
|
|
224
|
+
*/
|
|
225
|
+
export interface PostMonitorMetrics {
|
|
226
|
+
hours: number;
|
|
227
|
+
buckets: Array<PostMonitorMetricsBucket>;
|
|
228
|
+
}
|
|
229
|
+
/**
|
|
230
|
+
* A post metric's change since its last event, on post.likes.changed,
|
|
231
|
+
* post.retweets.changed, post.replies.changed, post.quotes.changed,
|
|
232
|
+
* post.bookmarks.changed & post.views.changed.
|
|
233
|
+
*/
|
|
234
|
+
export interface MonitorPostMetricChange {
|
|
235
|
+
/**
|
|
236
|
+
* Current count minus previous count.
|
|
237
|
+
*/
|
|
238
|
+
change: number;
|
|
239
|
+
/**
|
|
240
|
+
* The count X shows now.
|
|
241
|
+
*/
|
|
242
|
+
current: number;
|
|
243
|
+
/**
|
|
244
|
+
* The metric that changed.
|
|
245
|
+
*/
|
|
246
|
+
metric: 'bookmarks' | 'likes' | 'quotes' | 'replies' | 'retweets' | 'views';
|
|
247
|
+
/**
|
|
248
|
+
* The count the last event of this metric reported.
|
|
249
|
+
*/
|
|
250
|
+
previous: number;
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* The post's text before & after an edit, on post.edited.
|
|
254
|
+
*/
|
|
255
|
+
export interface MonitorPostEdit {
|
|
256
|
+
/**
|
|
257
|
+
* The text before the edit.
|
|
258
|
+
*/
|
|
259
|
+
previousText: string;
|
|
260
|
+
/**
|
|
261
|
+
* The text of the newest version.
|
|
262
|
+
*/
|
|
263
|
+
text: string;
|
|
264
|
+
/**
|
|
265
|
+
* X's ID of the newest version of the post.
|
|
266
|
+
*/
|
|
267
|
+
versionId: string;
|
|
268
|
+
}
|
|
269
|
+
/**
|
|
270
|
+
* The last text the monitor saw, on post.deleted.
|
|
271
|
+
*/
|
|
272
|
+
export interface MonitorPostDeleted {
|
|
273
|
+
/**
|
|
274
|
+
* The post's text before its author deleted it.
|
|
275
|
+
*/
|
|
276
|
+
text: string;
|
|
277
|
+
}
|
|
278
|
+
export interface PostListResponse {
|
|
279
|
+
hasMore: boolean;
|
|
280
|
+
monitors: Array<PostMonitor>;
|
|
281
|
+
/**
|
|
282
|
+
* Post monitors on this page.
|
|
283
|
+
*/
|
|
284
|
+
total: number;
|
|
285
|
+
nextCursor?: string;
|
|
286
|
+
}
|
|
287
|
+
export interface PostDeleteResponse {
|
|
288
|
+
deletionStatus: 'deleting';
|
|
289
|
+
/**
|
|
290
|
+
* Poll this monitor URL until it returns 404.
|
|
291
|
+
*/
|
|
292
|
+
statusUrl: string;
|
|
293
|
+
success: true;
|
|
294
|
+
}
|
|
295
|
+
export interface PostCreateParams {
|
|
296
|
+
/**
|
|
297
|
+
* Post link or ID. x.com, twitter.com, mobile & /i/web/status/ links work
|
|
298
|
+
* with any query string.
|
|
299
|
+
*/
|
|
300
|
+
post: string;
|
|
301
|
+
/**
|
|
302
|
+
* Post event types to send. Without it, a monitor sends new replies, new
|
|
303
|
+
* quotes, like & retweet changes, edits & deletion.
|
|
304
|
+
*/
|
|
305
|
+
eventTypes?: Array<PostEventType>;
|
|
306
|
+
/**
|
|
307
|
+
* Your own label for the post monitor. Its events carry it as monitorName.
|
|
308
|
+
*/
|
|
309
|
+
name?: string | null;
|
|
310
|
+
}
|
|
311
|
+
export interface PostUpdateParams {
|
|
312
|
+
/**
|
|
313
|
+
* Post event types to send. Without it, a monitor sends new replies, new
|
|
314
|
+
* quotes, like & retweet changes, edits & deletion.
|
|
315
|
+
*/
|
|
316
|
+
eventTypes?: Array<PostEventType>;
|
|
317
|
+
isActive?: boolean;
|
|
318
|
+
/**
|
|
319
|
+
* New label for the post monitor. Send null to remove it.
|
|
320
|
+
*/
|
|
321
|
+
name?: string | null;
|
|
322
|
+
}
|
|
323
|
+
export interface PostListParams {
|
|
324
|
+
/**
|
|
325
|
+
* Previous nextCursor. The after alias also works. Offset pagination is not
|
|
326
|
+
* supported.
|
|
327
|
+
*/
|
|
328
|
+
cursor?: string;
|
|
329
|
+
/**
|
|
330
|
+
* Maximum items per page, from 1 to 200. Default 200. Pass nextCursor as
|
|
331
|
+
* cursor for the next page.
|
|
332
|
+
*/
|
|
333
|
+
limit?: number;
|
|
334
|
+
}
|
|
335
|
+
export interface PostRetrieveMetricsParams {
|
|
336
|
+
/**
|
|
337
|
+
* Hours to return, from 1 to 720.
|
|
338
|
+
*/
|
|
339
|
+
hours?: number;
|
|
340
|
+
}
|
|
341
|
+
export declare namespace Posts {
|
|
342
|
+
export { type PostEventType as PostEventType, type PostMetricReading as PostMetricReading, type PostMetrics as PostMetrics, type PostMonitor as PostMonitor, type PostMetricPoint as PostMetricPoint, type PostMonitorMetricsBucketMetrics as PostMonitorMetricsBucketMetrics, type PostMonitorMetricsBucket as PostMonitorMetricsBucket, type PostMonitorMetrics as PostMonitorMetrics, type MonitorPostMetricChange as MonitorPostMetricChange, type MonitorPostEdit as MonitorPostEdit, type MonitorPostDeleted as MonitorPostDeleted, type PostListResponse as PostListResponse, type PostDeleteResponse as PostDeleteResponse, type PostCreateParams as PostCreateParams, type PostUpdateParams as PostUpdateParams, type PostListParams as PostListParams, type PostRetrieveMetricsParams as PostRetrieveMetricsParams, };
|
|
343
|
+
}
|
|
344
|
+
//# sourceMappingURL=posts.d.ts.map
|