Skip to content

Commit ff8612e

Browse files
chore: sync generated SDK contracts
1 parent a7059e9 commit ff8612e

8 files changed

Lines changed: 250 additions & 90 deletions

File tree

.stats.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
11
configured_endpoints: 122
2-
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik/x-twitter-scraper-a89d9fe0de8895b2daf847c8f3ff8bc93f43039c040d0bf093ec6dc1e734f57b.yml
3-
openapi_spec_hash: c6365ebfe4f85183f384f27865cf66ce
4-
config_hash: 9a418581d96f0820ef923bfe5ffa2541
2+
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik/x-twitter-scraper-60015c41765cef9b710831981537d0e036fa38d4dd8b394e682276cf4d21cd87.yml
3+
openapi_spec_hash: 522c22a20935010efb8c1212a0d899b7
4+
config_hash: 17c84052d27489691ee6dd861cc56e24

CODE_OF_CONDUCT.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,4 +82,3 @@ For answers to common questions about this code of conduct, see the FAQ at [http
8282
[Mozilla CoC]: https://github.com/mozilla/diversity
8383
[FAQ]: https://www.contributor-covenant.org/faq
8484
[translations]: https://www.contributor-covenant.org/translations
85-

src/client.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -918,7 +918,7 @@ export class XTwitterScraper {
918918
*/
919919
radar: API.Radar = new API.Radar(this);
920920
/**
921-
* Real-time X account monitoring
921+
* X account monitoring with 1-second checks
922922
*/
923923
monitors: API.Monitors = new API.Monitors(this);
924924
/**

src/resources/account.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -89,12 +89,12 @@ export namespace AccountRetrieveResponse {
8989
activeHourlyBurn: string;
9090

9191
/**
92-
* Estimated daily usage for 1 active instant monitor.
92+
* Rounded daily estimate for 1 active monitor.
9393
*/
9494
creditsPerActiveMonitorDay: string;
9595

9696
/**
97-
* Hourly usage charged for 1 active instant monitor.
97+
* Hourly credits charged for 1 active monitor.
9898
*/
9999
creditsPerActiveMonitorHour: string;
100100

src/resources/compose.ts

Lines changed: 232 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,17 @@ import { RequestOptions } from '../internal/request-options';
99
*/
1010
export class Compose extends APIResource {
1111
/**
12-
* Compose, refine, or score a tweet
12+
* Run one step of Xquik's three-step writing workflow. Compose returns questions
13+
* and editorial rules. Refine returns goal-specific guidance. Score applies
14+
* deterministic text checks. It does not predict reach or expose X ranking
15+
* weights.
1316
*
1417
* @example
1518
* ```ts
1619
* const compose = await client.compose.create({
1720
* step: 'compose',
21+
* topic: 'PostgreSQL query planning',
1822
* goal: 'engagement',
19-
* topic: 'AI trends in 2025',
2023
* });
2124
* ```
2225
*/
@@ -25,85 +28,249 @@ export class Compose extends APIResource {
2528
}
2629
}
2730

28-
export interface ComposeCreateResponse {
29-
/**
30-
* AI feedback on the draft
31-
*/
32-
feedback?: string;
31+
export type ComposeCreateResponse =
32+
| ComposeCreateResponse.ComposePrepareResult
33+
| ComposeCreateResponse.ComposeRefineResult
34+
| ComposeCreateResponse.ComposeScoreResult;
3335

34-
/**
35-
* Engagement score (0-100)
36-
*/
37-
score?: number;
36+
export namespace ComposeCreateResponse {
37+
export interface ComposePrepareResult {
38+
/**
39+
* Xquik editorial heuristics, ordered for the goal.
40+
*/
41+
contentRules: Array<ComposePrepareResult.ContentRule>;
3842

39-
/**
40-
* Improvement suggestions
41-
*/
42-
suggestions?: Array<string>;
43+
/**
44+
* Published engagement signal names. Production multipliers are not published.
45+
*/
46+
engagementMultipliers: Array<ComposePrepareResult.EngagementMultiplier>;
4347

44-
/**
45-
* Generated or refined tweet text
46-
*/
47-
text?: string;
48+
/**
49+
* Publication limit for timing and decay claims.
50+
*/
51+
engagementVelocity: string;
52+
53+
followUpQuestions: Array<string>;
54+
55+
/**
56+
* X post intent seeded with the topic.
57+
*/
58+
intentUrl: string;
59+
60+
nextStep: string;
61+
62+
/**
63+
* Published signal names with unpublished weights as null.
64+
*/
65+
scorerWeights: Array<ComposePrepareResult.ScorerWeight>;
66+
67+
/**
68+
* Signal source and evidence limits.
69+
*/
70+
source: string;
71+
72+
/**
73+
* Negative engagement predictions in the public model.
74+
*/
75+
topPenalties: Array<string>;
76+
77+
/**
78+
* Style analyses saved to the account.
79+
*/
80+
savedStyles?: Array<ComposePrepareResult.SavedStyle>;
81+
82+
/**
83+
* Next action when no cached style is available.
84+
*/
85+
styleNote?: string;
86+
87+
/**
88+
* Cached examples for the requested style username.
89+
*/
90+
styleTweets?: Array<string>;
91+
}
92+
93+
export namespace ComposePrepareResult {
94+
export interface ContentRule {
95+
rule: string;
96+
}
97+
98+
export interface EngagementMultiplier {
99+
/**
100+
* Human-readable published signal name.
101+
*/
102+
action: string;
103+
104+
multiplier: 'Production weight not published by X';
105+
}
106+
107+
export interface ScorerWeight {
108+
/**
109+
* Signal direction and publication limit.
110+
*/
111+
context: string;
112+
113+
/**
114+
* Signal name from X's public ranking repository.
115+
*/
116+
signal: string;
117+
118+
/**
119+
* X does not publish the production weight.
120+
*/
121+
weight: null;
122+
}
123+
124+
export interface SavedStyle {
125+
tweetCount: number;
126+
127+
username: string;
128+
}
129+
}
130+
131+
export interface ComposeRefineResult {
132+
/**
133+
* Goal, tone, media, and editorial guidance.
134+
*/
135+
compositionGuidance: Array<string>;
136+
137+
examplePatterns: Array<ComposeRefineResult.ExamplePattern>;
138+
139+
/**
140+
* X post intent seeded with the topic.
141+
*/
142+
intentUrl: string;
143+
144+
nextStep: string;
145+
}
146+
147+
export namespace ComposeRefineResult {
148+
export interface ExamplePattern {
149+
description: string;
150+
151+
pattern: string;
152+
}
153+
}
154+
155+
export interface ComposeScoreResult {
156+
/**
157+
* Deterministic editorial checks. Not a reach prediction.
158+
*/
159+
checklist: Array<ComposeScoreResult.Checklist>;
160+
161+
nextStep: string;
162+
163+
passed: boolean;
164+
165+
passedCount: number;
166+
167+
topSuggestion: string;
48168

49-
[k: string]: unknown;
169+
totalChecks: 9;
170+
171+
/**
172+
* Present only when every check passes.
173+
*/
174+
intentUrl?: string;
175+
}
176+
177+
export namespace ComposeScoreResult {
178+
export interface Checklist {
179+
factor: string;
180+
181+
passed: boolean;
182+
183+
/**
184+
* Present only when the check fails.
185+
*/
186+
suggestion?: string;
187+
}
188+
}
50189
}
51190

52-
export interface ComposeCreateParams {
53-
/**
54-
* Workflow step
55-
*/
56-
step: 'compose' | 'refine' | 'score';
191+
export type ComposeCreateParams =
192+
| ComposeCreateParams.ComposePrepareRequest
193+
| ComposeCreateParams.ComposeRefineRequest
194+
| ComposeCreateParams.ComposeScoreRequest;
57195

58-
/**
59-
* Extra context or URLs (refine)
60-
*/
61-
additionalContext?: string;
196+
export declare namespace ComposeCreateParams {
197+
export interface ComposePrepareRequest {
198+
step: 'compose';
62199

63-
/**
64-
* Desired call to action (refine)
65-
*/
66-
callToAction?: string;
200+
/**
201+
* Subject for the post.
202+
*/
203+
topic: string;
67204

68-
/**
69-
* Tweet draft text to evaluate (score)
70-
*/
71-
draft?: string;
205+
/**
206+
* Editorial goal used to order the rules and questions.
207+
*/
208+
goal?: 'engagement' | 'followers' | 'authority' | 'conversation';
72209

73-
/**
74-
* Optimization goal
75-
*/
76-
goal?: 'engagement' | 'followers' | 'authority' | 'conversation';
210+
/**
211+
* Username from a style analysis saved to this account.
212+
*/
213+
styleUsername?: string;
77214

78-
/**
79-
* Whether a link is attached (score)
80-
*/
81-
hasLink?: boolean;
215+
[k: string]: unknown;
216+
}
82217

83-
/**
84-
* Whether media is attached (score)
85-
*/
86-
hasMedia?: boolean;
218+
export interface ComposeRefineRequest {
219+
/**
220+
* Editorial goal for the guidance.
221+
*/
222+
goal: 'engagement' | 'followers' | 'authority' | 'conversation';
87223

88-
/**
89-
* Media type (refine)
90-
*/
91-
mediaType?: 'photo' | 'video' | 'none';
224+
step: 'refine';
92225

93-
/**
94-
* Cached style username for voice matching (compose)
95-
*/
96-
styleUsername?: string;
226+
/**
227+
* Requested writing tone.
228+
*/
229+
tone: string;
97230

98-
/**
99-
* Desired tone (refine)
100-
*/
101-
tone?: string;
231+
/**
232+
* Subject for the post.
233+
*/
234+
topic: string;
102235

103-
/**
104-
* Tweet topic (compose, refine)
105-
*/
106-
topic?: string;
236+
/**
237+
* Audience, constraints, sources, or other writing context.
238+
*/
239+
additionalContext?: string;
240+
241+
/**
242+
* Specific action the draft should request.
243+
*/
244+
callToAction?: string;
245+
246+
/**
247+
* Planned media type.
248+
*/
249+
mediaType?: 'photo' | 'video' | 'none';
250+
251+
[k: string]: unknown;
252+
}
253+
254+
export interface ComposeScoreRequest {
255+
/**
256+
* Full post text for deterministic editorial checks.
257+
*/
258+
draft: string;
259+
260+
step: 'score';
261+
262+
/**
263+
* True when a separate link card is attached.
264+
*/
265+
hasLink?: boolean;
266+
267+
/**
268+
* @deprecated Accepted for backward compatibility. Text checks ignore this field.
269+
*/
270+
hasMedia?: boolean;
271+
272+
[k: string]: unknown;
273+
}
107274
}
108275

109276
export declare namespace Compose {

src/resources/monitors/keywords.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,13 +7,13 @@ import { RequestOptions } from '../../internal/request-options';
77
import { path } from '../../internal/utils/path';
88

99
/**
10-
* Real-time X account monitoring
10+
* X account monitoring with 1-second checks
1111
*/
1212
export class Keywords extends APIResource {
1313
/**
14-
* Creates an instant keyword monitor. Keyword monitors are unlimited. Active
15-
* monitors check every 1 second. Events and webhook deliveries are included.
16-
* Creation requires an available usage balance.
14+
* Creates a keyword monitor. Keyword monitors are unlimited. Active monitors check
15+
* every 1 second and cost 21 credits per hour. Events and webhook deliveries are
16+
* included. Creation requires available credits for the first hourly charge.
1717
*
1818
* @example
1919
* ```ts

0 commit comments

Comments
 (0)