Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .release-please-manifest.json
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
{
".": "0.2.0"
".": "0.3.0"
}
4 changes: 2 additions & 2 deletions .stats.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
configured_endpoints: 115
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik%2Fx-twitter-scraper-3b2c6c771ad1da0bbfeb0af115972929ed2c7fcd5e47a79556d66cd21431b224.yml
openapi_spec_hash: de2890233b68387bf5f9b6d19e7d87dc
openapi_spec_url: https://storage.googleapis.com/stainless-sdk-openapi-specs/xquik%2Fx-twitter-scraper-93bb7d4f1475c8043af464ec88244a034456c549136c8477f284f0a33192e1c9.yml
openapi_spec_hash: 74dca63c872249274ad99b111dea0833
config_hash: 8894c96caeb6df84c9394518810221bd
8 changes: 8 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## 0.3.0 (2026-04-01)

Full Changelog: [v0.2.0...v0.3.0](https://github.com/Xquik-dev/x-twitter-scraper-php/compare/v0.2.0...v0.3.0)

### Features

* **api:** api update ([f236745](https://github.com/Xquik-dev/x-twitter-scraper-php/commit/f2367453aa8f6982522697df842e60e4b95f7ff1))

## 0.2.0 (2026-04-01)

Full Changelog: [v0.1.0...v0.2.0](https://github.com/Xquik-dev/x-twitter-scraper-php/compare/v0.1.0...v0.2.0)
Expand Down
123 changes: 123 additions & 0 deletions src/Compose/ComposeNewResponse.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,123 @@
<?php

declare(strict_types=1);

namespace XTwitterScraper\Compose;

use XTwitterScraper\Core\Attributes\Optional;
use XTwitterScraper\Core\Concerns\SdkModel;
use XTwitterScraper\Core\Contracts\BaseModel;

/**
* @phpstan-type ComposeNewResponseShape = array{
* feedback?: string|null,
* score?: float|null,
* suggestions?: list<string>|null,
* text?: string|null,
* }
*/
final class ComposeNewResponse implements BaseModel
{
/** @use SdkModel<ComposeNewResponseShape> */
use SdkModel;

/**
* AI feedback on the draft.
*/
#[Optional]
public ?string $feedback;

/**
* Engagement score (0-100).
*/
#[Optional]
public ?float $score;

/**
* Improvement suggestions.
*
* @var list<string>|null $suggestions
*/
#[Optional(list: 'string')]
public ?array $suggestions;

/**
* Generated or refined tweet text.
*/
#[Optional]
public ?string $text;

public function __construct()
{
$this->initialize();
}

/**
* Construct an instance from the required parameters.
*
* You must use named parameters to construct any parameters with a default value.
*
* @param list<string>|null $suggestions
*/
public static function with(
?string $feedback = null,
?float $score = null,
?array $suggestions = null,
?string $text = null,
): self {
$self = new self;

null !== $feedback && $self['feedback'] = $feedback;
null !== $score && $self['score'] = $score;
null !== $suggestions && $self['suggestions'] = $suggestions;
null !== $text && $self['text'] = $text;

return $self;
}

/**
* AI feedback on the draft.
*/
public function withFeedback(string $feedback): self
{
$self = clone $this;
$self['feedback'] = $feedback;

return $self;
}

/**
* Engagement score (0-100).
*/
public function withScore(float $score): self
{
$self = clone $this;
$self['score'] = $score;

return $self;
}

/**
* Improvement suggestions.
*
* @param list<string> $suggestions
*/
public function withSuggestions(array $suggestions): self
{
$self = clone $this;
$self['suggestions'] = $suggestions;

return $self;
}

/**
* Generated or refined tweet text.
*/
public function withText(string $text): self
{
$self = clone $this;
$self['text'] = $text;

return $self;
}
}
8 changes: 7 additions & 1 deletion src/Events/EventDetail.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ final class EventDetail implements BaseModel
#[Required]
public string $id;

/** @var array<string,mixed> $data */
/**
* Event payload — shape varies by event type (JSON).
*
* @var array<string,mixed> $data
*/
#[Required(map: 'mixed')]
public array $data;

Expand Down Expand Up @@ -116,6 +120,8 @@ public function withID(string $id): self
}

/**
* Event payload — shape varies by event type (JSON).
*
* @param array<string,mixed> $data
*/
public function withData(array $data): self
Expand Down
8 changes: 7 additions & 1 deletion src/Events/EventGetResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,11 @@ final class EventGetResponse implements BaseModel
#[Required]
public string $id;

/** @var array<string,mixed> $data */
/**
* Event payload — shape varies by event type (JSON).
*
* @var array<string,mixed> $data
*/
#[Required(map: 'mixed')]
public array $data;

Expand Down Expand Up @@ -116,6 +120,8 @@ public function withID(string $id): self
}

/**
* Event payload — shape varies by event type (JSON).
*
* @param array<string,mixed> $data
*/
public function withData(array $data): self
Expand Down
8 changes: 7 additions & 1 deletion src/Extractions/ExtractionGetResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,11 @@ final class ExtractionGetResponse implements BaseModel
#[Required]
public bool $hasMore;

/** @var array<string,mixed> $job */
/**
* Extraction job metadata — shape varies by tool type (JSON).
*
* @var array<string,mixed> $job
*/
#[Required(map: 'mixed')]
public array $job;

Expand Down Expand Up @@ -90,6 +94,8 @@ public function withHasMore(bool $hasMore): self
}

/**
* Extraction job metadata — shape varies by tool type (JSON).
*
* @param array<string,mixed> $job
*/
public function withJob(array $job): self
Expand Down
16 changes: 14 additions & 2 deletions src/Integrations/Integration.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ final class Integration implements BaseModel
#[Required]
public string $id;

/** @var array<string,mixed> $config */
/**
* Integration config — shape varies by type (JSON).
*
* @var array<string,mixed> $config
*/
#[Required(map: 'mixed')]
public array $config;

Expand All @@ -55,7 +59,11 @@ final class Integration implements BaseModel
#[Required(enum: Type::class)]
public string $type;

/** @var array<string,mixed>|null $filters */
/**
* Event filter rules (JSON).
*
* @var array<string,mixed>|null $filters
*/
#[Optional(map: 'mixed')]
public ?array $filters;

Expand Down Expand Up @@ -152,6 +160,8 @@ public function withID(string $id): self
}

/**
* Integration config — shape varies by type (JSON).
*
* @param array<string,mixed> $config
*/
public function withConfig(array $config): self
Expand Down Expand Up @@ -209,6 +219,8 @@ public function withType(Type|string $type): self
}

/**
* Event filter rules (JSON).
*
* @param array<string,mixed> $filters
*/
public function withFilters(array $filters): self
Expand Down
16 changes: 14 additions & 2 deletions src/Integrations/IntegrationGetResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ final class IntegrationGetResponse implements BaseModel
#[Required]
public string $id;

/** @var array<string,mixed> $config */
/**
* Integration config — shape varies by type (JSON).
*
* @var array<string,mixed> $config
*/
#[Required(map: 'mixed')]
public array $config;

Expand All @@ -55,7 +59,11 @@ final class IntegrationGetResponse implements BaseModel
#[Required(enum: Type::class)]
public string $type;

/** @var array<string,mixed>|null $filters */
/**
* Event filter rules (JSON).
*
* @var array<string,mixed>|null $filters
*/
#[Optional(map: 'mixed')]
public ?array $filters;

Expand Down Expand Up @@ -152,6 +160,8 @@ public function withID(string $id): self
}

/**
* Integration config — shape varies by type (JSON).
*
* @param array<string,mixed> $config
*/
public function withConfig(array $config): self
Expand Down Expand Up @@ -209,6 +219,8 @@ public function withType(Type|string $type): self
}

/**
* Event filter rules (JSON).
*
* @param array<string,mixed> $filters
*/
public function withFilters(array $filters): self
Expand Down
16 changes: 14 additions & 2 deletions src/Integrations/IntegrationListResponse/Integration.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ final class Integration implements BaseModel
#[Required]
public string $id;

/** @var array<string,mixed> $config */
/**
* Integration config — shape varies by type (JSON).
*
* @var array<string,mixed> $config
*/
#[Required(map: 'mixed')]
public array $config;

Expand All @@ -55,7 +59,11 @@ final class Integration implements BaseModel
#[Required(enum: Type::class)]
public string $type;

/** @var array<string,mixed>|null $filters */
/**
* Event filter rules (JSON).
*
* @var array<string,mixed>|null $filters
*/
#[Optional(map: 'mixed')]
public ?array $filters;

Expand Down Expand Up @@ -152,6 +160,8 @@ public function withID(string $id): self
}

/**
* Integration config — shape varies by type (JSON).
*
* @param array<string,mixed> $config
*/
public function withConfig(array $config): self
Expand Down Expand Up @@ -209,6 +219,8 @@ public function withType(Type|string $type): self
}

/**
* Event filter rules (JSON).
*
* @param array<string,mixed> $filters
*/
public function withFilters(array $filters): self
Expand Down
16 changes: 14 additions & 2 deletions src/Integrations/IntegrationNewResponse.php
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,11 @@ final class IntegrationNewResponse implements BaseModel
#[Required]
public string $id;

/** @var array<string,mixed> $config */
/**
* Integration config — shape varies by type (JSON).
*
* @var array<string,mixed> $config
*/
#[Required(map: 'mixed')]
public array $config;

Expand All @@ -55,7 +59,11 @@ final class IntegrationNewResponse implements BaseModel
#[Required(enum: Type::class)]
public string $type;

/** @var array<string,mixed>|null $filters */
/**
* Event filter rules (JSON).
*
* @var array<string,mixed>|null $filters
*/
#[Optional(map: 'mixed')]
public ?array $filters;

Expand Down Expand Up @@ -152,6 +160,8 @@ public function withID(string $id): self
}

/**
* Integration config — shape varies by type (JSON).
*
* @param array<string,mixed> $config
*/
public function withConfig(array $config): self
Expand Down Expand Up @@ -209,6 +219,8 @@ public function withType(Type|string $type): self
}

/**
* Event filter rules (JSON).
*
* @param array<string,mixed> $filters
*/
public function withFilters(array $filters): self
Expand Down
Loading
Loading