From ff8612e3b474a71aabae2f709ae93a487d5ad69d Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 22 Jul 2026 19:21:35 +0000 Subject: [PATCH 1/3] chore: sync generated SDK contracts --- .stats.yml | 6 +- CODE_OF_CONDUCT.md | 1 - src/client.ts | 2 +- src/resources/account.ts | 4 +- src/resources/compose.ts | 297 ++++++++++++++++++++++------ src/resources/monitors/keywords.ts | 8 +- src/resources/monitors/monitors.ts | 9 +- tests/api-resources/compose.test.ts | 13 +- 8 files changed, 250 insertions(+), 90 deletions(-) diff --git a/.stats.yml b/.stats.yml index e6012c9..ab7945d 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 122 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik/x-twitter-scraper-a89d9fe0de8895b2daf847c8f3ff8bc93f43039c040d0bf093ec6dc1e734f57b.yml -openapi_spec_hash: c6365ebfe4f85183f384f27865cf66ce -config_hash: 9a418581d96f0820ef923bfe5ffa2541 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik/x-twitter-scraper-60015c41765cef9b710831981537d0e036fa38d4dd8b394e682276cf4d21cd87.yml +openapi_spec_hash: 522c22a20935010efb8c1212a0d899b7 +config_hash: 17c84052d27489691ee6dd861cc56e24 diff --git a/CODE_OF_CONDUCT.md b/CODE_OF_CONDUCT.md index 0f624a1..279f820 100644 --- a/CODE_OF_CONDUCT.md +++ b/CODE_OF_CONDUCT.md @@ -82,4 +82,3 @@ For answers to common questions about this code of conduct, see the FAQ at [http [Mozilla CoC]: https://github.com/mozilla/diversity [FAQ]: https://www.contributor-covenant.org/faq [translations]: https://www.contributor-covenant.org/translations - diff --git a/src/client.ts b/src/client.ts index c093618..c87ef95 100644 --- a/src/client.ts +++ b/src/client.ts @@ -918,7 +918,7 @@ export class XTwitterScraper { */ radar: API.Radar = new API.Radar(this); /** - * Real-time X account monitoring + * X account monitoring with 1-second checks */ monitors: API.Monitors = new API.Monitors(this); /** diff --git a/src/resources/account.ts b/src/resources/account.ts index fa3b30e..8444c84 100644 --- a/src/resources/account.ts +++ b/src/resources/account.ts @@ -89,12 +89,12 @@ export namespace AccountRetrieveResponse { activeHourlyBurn: string; /** - * Estimated daily usage for 1 active instant monitor. + * Rounded daily estimate for 1 active monitor. */ creditsPerActiveMonitorDay: string; /** - * Hourly usage charged for 1 active instant monitor. + * Hourly credits charged for 1 active monitor. */ creditsPerActiveMonitorHour: string; diff --git a/src/resources/compose.ts b/src/resources/compose.ts index d1201e4..de9af82 100644 --- a/src/resources/compose.ts +++ b/src/resources/compose.ts @@ -9,14 +9,17 @@ import { RequestOptions } from '../internal/request-options'; */ export class Compose extends APIResource { /** - * Compose, refine, or score a tweet + * Run one step of Xquik's three-step writing workflow. Compose returns questions + * and editorial rules. Refine returns goal-specific guidance. Score applies + * deterministic text checks. It does not predict reach or expose X ranking + * weights. * * @example * ```ts * const compose = await client.compose.create({ * step: 'compose', + * topic: 'PostgreSQL query planning', * goal: 'engagement', - * topic: 'AI trends in 2025', * }); * ``` */ @@ -25,85 +28,249 @@ export class Compose extends APIResource { } } -export interface ComposeCreateResponse { - /** - * AI feedback on the draft - */ - feedback?: string; +export type ComposeCreateResponse = + | ComposeCreateResponse.ComposePrepareResult + | ComposeCreateResponse.ComposeRefineResult + | ComposeCreateResponse.ComposeScoreResult; - /** - * Engagement score (0-100) - */ - score?: number; +export namespace ComposeCreateResponse { + export interface ComposePrepareResult { + /** + * Xquik editorial heuristics, ordered for the goal. + */ + contentRules: Array; - /** - * Improvement suggestions - */ - suggestions?: Array; + /** + * Published engagement signal names. Production multipliers are not published. + */ + engagementMultipliers: Array; - /** - * Generated or refined tweet text - */ - text?: string; + /** + * Publication limit for timing and decay claims. + */ + engagementVelocity: string; + + followUpQuestions: Array; + + /** + * X post intent seeded with the topic. + */ + intentUrl: string; + + nextStep: string; + + /** + * Published signal names with unpublished weights as null. + */ + scorerWeights: Array; + + /** + * Signal source and evidence limits. + */ + source: string; + + /** + * Negative engagement predictions in the public model. + */ + topPenalties: Array; + + /** + * Style analyses saved to the account. + */ + savedStyles?: Array; + + /** + * Next action when no cached style is available. + */ + styleNote?: string; + + /** + * Cached examples for the requested style username. + */ + styleTweets?: Array; + } + + export namespace ComposePrepareResult { + export interface ContentRule { + rule: string; + } + + export interface EngagementMultiplier { + /** + * Human-readable published signal name. + */ + action: string; + + multiplier: 'Production weight not published by X'; + } + + export interface ScorerWeight { + /** + * Signal direction and publication limit. + */ + context: string; + + /** + * Signal name from X's public ranking repository. + */ + signal: string; + + /** + * X does not publish the production weight. + */ + weight: null; + } + + export interface SavedStyle { + tweetCount: number; + + username: string; + } + } + + export interface ComposeRefineResult { + /** + * Goal, tone, media, and editorial guidance. + */ + compositionGuidance: Array; + + examplePatterns: Array; + + /** + * X post intent seeded with the topic. + */ + intentUrl: string; + + nextStep: string; + } + + export namespace ComposeRefineResult { + export interface ExamplePattern { + description: string; + + pattern: string; + } + } + + export interface ComposeScoreResult { + /** + * Deterministic editorial checks. Not a reach prediction. + */ + checklist: Array; + + nextStep: string; + + passed: boolean; + + passedCount: number; + + topSuggestion: string; - [k: string]: unknown; + totalChecks: 9; + + /** + * Present only when every check passes. + */ + intentUrl?: string; + } + + export namespace ComposeScoreResult { + export interface Checklist { + factor: string; + + passed: boolean; + + /** + * Present only when the check fails. + */ + suggestion?: string; + } + } } -export interface ComposeCreateParams { - /** - * Workflow step - */ - step: 'compose' | 'refine' | 'score'; +export type ComposeCreateParams = + | ComposeCreateParams.ComposePrepareRequest + | ComposeCreateParams.ComposeRefineRequest + | ComposeCreateParams.ComposeScoreRequest; - /** - * Extra context or URLs (refine) - */ - additionalContext?: string; +export declare namespace ComposeCreateParams { + export interface ComposePrepareRequest { + step: 'compose'; - /** - * Desired call to action (refine) - */ - callToAction?: string; + /** + * Subject for the post. + */ + topic: string; - /** - * Tweet draft text to evaluate (score) - */ - draft?: string; + /** + * Editorial goal used to order the rules and questions. + */ + goal?: 'engagement' | 'followers' | 'authority' | 'conversation'; - /** - * Optimization goal - */ - goal?: 'engagement' | 'followers' | 'authority' | 'conversation'; + /** + * Username from a style analysis saved to this account. + */ + styleUsername?: string; - /** - * Whether a link is attached (score) - */ - hasLink?: boolean; + [k: string]: unknown; + } - /** - * Whether media is attached (score) - */ - hasMedia?: boolean; + export interface ComposeRefineRequest { + /** + * Editorial goal for the guidance. + */ + goal: 'engagement' | 'followers' | 'authority' | 'conversation'; - /** - * Media type (refine) - */ - mediaType?: 'photo' | 'video' | 'none'; + step: 'refine'; - /** - * Cached style username for voice matching (compose) - */ - styleUsername?: string; + /** + * Requested writing tone. + */ + tone: string; - /** - * Desired tone (refine) - */ - tone?: string; + /** + * Subject for the post. + */ + topic: string; - /** - * Tweet topic (compose, refine) - */ - topic?: string; + /** + * Audience, constraints, sources, or other writing context. + */ + additionalContext?: string; + + /** + * Specific action the draft should request. + */ + callToAction?: string; + + /** + * Planned media type. + */ + mediaType?: 'photo' | 'video' | 'none'; + + [k: string]: unknown; + } + + export interface ComposeScoreRequest { + /** + * Full post text for deterministic editorial checks. + */ + draft: string; + + step: 'score'; + + /** + * True when a separate link card is attached. + */ + hasLink?: boolean; + + /** + * @deprecated Accepted for backward compatibility. Text checks ignore this field. + */ + hasMedia?: boolean; + + [k: string]: unknown; + } } export declare namespace Compose { diff --git a/src/resources/monitors/keywords.ts b/src/resources/monitors/keywords.ts index adeda6c..b96fbca 100644 --- a/src/resources/monitors/keywords.ts +++ b/src/resources/monitors/keywords.ts @@ -7,13 +7,13 @@ import { RequestOptions } from '../../internal/request-options'; import { path } from '../../internal/utils/path'; /** - * Real-time X account monitoring + * X account monitoring with 1-second checks */ export class Keywords extends APIResource { /** - * Creates an instant keyword monitor. Keyword monitors are unlimited. Active - * monitors check every 1 second. Events and webhook deliveries are included. - * Creation requires an available usage balance. + * Creates a keyword monitor. Keyword monitors are unlimited. Active monitors check + * every 1 second and cost 21 credits per hour. Events and webhook deliveries are + * included. Creation requires available credits for the first hourly charge. * * @example * ```ts diff --git a/src/resources/monitors/monitors.ts b/src/resources/monitors/monitors.ts index 2ccae1a..8b11b2b 100644 --- a/src/resources/monitors/monitors.ts +++ b/src/resources/monitors/monitors.ts @@ -18,15 +18,16 @@ import { RequestOptions } from '../../internal/request-options'; import { path } from '../../internal/utils/path'; /** - * Real-time X account monitoring + * X account monitoring with 1-second checks */ export class Monitors extends APIResource { keywords: KeywordsAPI.Keywords = new KeywordsAPI.Keywords(this._client); /** - * Creates an instant monitor. Monitors are unlimited. Active monitors check every - * 1 second. Events and webhook deliveries are included. Creation requires an - * available usage balance. + * Creates an account monitor. Monitors are unlimited. Active monitors check every + * 1 second and cost 21 credits per hour. Events and webhook deliveries are + * included. Creation requires available credits for the first hourly charge and + * username lookup. * * @example * ```ts diff --git a/tests/api-resources/compose.test.ts b/tests/api-resources/compose.test.ts index 4cb35c4..bbdf9aa 100644 --- a/tests/api-resources/compose.test.ts +++ b/tests/api-resources/compose.test.ts @@ -10,7 +10,7 @@ const client = new XTwitterScraper({ describe('resource compose', () => { test('create: only required params', async () => { - const responsePromise = client.compose.create({ step: 'compose' }); + const responsePromise = client.compose.create({ step: 'compose', topic: 'PostgreSQL query planning' }); const rawResponse = await responsePromise.asResponse(); expect(rawResponse).toBeInstanceOf(Response); const response = await responsePromise; @@ -23,16 +23,9 @@ describe('resource compose', () => { test('create: required and optional params', async () => { const response = await client.compose.create({ step: 'compose', - additionalContext: 'https://x.com/elonmusk/status/1234567890', - callToAction: 'Follow for more', - draft: "AI is changing everything. Here's why.", + topic: 'PostgreSQL query planning', goal: 'engagement', - hasLink: false, - hasMedia: false, - mediaType: 'none', - styleUsername: 'elonmusk', - tone: 'professional', - topic: 'AI trends in 2025', + styleUsername: 'x', }); }); }); From bcd7c6adecf0e4f1dd42025a3c9615c3abcd4223 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 22 Jul 2026 20:15:08 +0000 Subject: [PATCH 2/3] chore: verify final public contract --- .stats.yml | 4 ++-- src/resources/compose.ts | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.stats.yml b/.stats.yml index ab7945d..4477ceb 100644 --- a/.stats.yml +++ b/.stats.yml @@ -1,4 +1,4 @@ configured_endpoints: 122 -openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik/x-twitter-scraper-60015c41765cef9b710831981537d0e036fa38d4dd8b394e682276cf4d21cd87.yml -openapi_spec_hash: 522c22a20935010efb8c1212a0d899b7 +openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik/x-twitter-scraper-26de9a1d18b92c9472fcc289877ba281ae305db846b7b14065142e26c7637d72.yml +openapi_spec_hash: f90f7016413291fdcbedb986385dc3ae config_hash: 17c84052d27489691ee6dd861cc56e24 diff --git a/src/resources/compose.ts b/src/resources/compose.ts index de9af82..f6be3b1 100644 --- a/src/resources/compose.ts +++ b/src/resources/compose.ts @@ -265,7 +265,7 @@ export declare namespace ComposeCreateParams { hasLink?: boolean; /** - * @deprecated Accepted for backward compatibility. Text checks ignore this field. + * @deprecated Ignored. Remove this field. Use hasLink for a separate link card. */ hasMedia?: boolean; From bc499bb81451c5d4994fca424175fb9cba081523 Mon Sep 17 00:00:00 2001 From: "stainless-app[bot]" <142633134+stainless-app[bot]@users.noreply.github.com> Date: Wed, 22 Jul 2026 20:15:30 +0000 Subject: [PATCH 3/3] release: 0.5.1 --- .release-please-manifest.json | 2 +- CHANGELOG.md | 9 +++++++++ package.json | 2 +- src/version.ts | 2 +- 4 files changed, 12 insertions(+), 3 deletions(-) diff --git a/.release-please-manifest.json b/.release-please-manifest.json index f1c1e58..210d290 100644 --- a/.release-please-manifest.json +++ b/.release-please-manifest.json @@ -1,3 +1,3 @@ { - ".": "0.5.0" + ".": "0.5.1" } diff --git a/CHANGELOG.md b/CHANGELOG.md index dd20604..c676fc1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # Changelog +## 0.5.1 (2026-07-22) + +Full Changelog: [v0.5.0...v0.5.1](https://github.com/Xquik-dev/x-twitter-scraper-typescript/compare/v0.5.0...v0.5.1) + +### Chores + +* sync generated SDK contracts ([ff8612e](https://github.com/Xquik-dev/x-twitter-scraper-typescript/commit/ff8612e3b474a71aabae2f709ae93a487d5ad69d)) +* verify final public contract ([bcd7c6a](https://github.com/Xquik-dev/x-twitter-scraper-typescript/commit/bcd7c6adecf0e4f1dd42025a3c9615c3abcd4223)) + ## 0.5.0 (2026-07-22) Full Changelog: [v0.4.1...v0.5.0](https://github.com/Xquik-dev/x-twitter-scraper-typescript/compare/v0.4.1...v0.5.0) diff --git a/package.json b/package.json index a7ab4f3..a898bce 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "x-twitter-scraper", - "version": "0.5.0", + "version": "0.5.1", "description": "TypeScript SDK for Xquik API workflows. Xquik is an independent third-party service. Not affiliated with X Corp. \"Twitter\" and \"X\" are trademarks of X Corp.", "author": "Xquik ", "types": "dist/index.d.ts", diff --git a/src/version.ts b/src/version.ts index 1f5d158..44c3338 100644 --- a/src/version.ts +++ b/src/version.ts @@ -1 +1 @@ -export const VERSION = '0.5.0'; // x-release-please-version +export const VERSION = '0.5.1'; // x-release-please-version